Syntax_Error
Syntax_Error

Reputation: 6230

Plotting bar and line on same graph in MATLAB

I have a data set in an array in Matlab and a point.

I would like to see where the new point stands with respect to the previous data.

I am currently plotting the array using:

PreviousPoints=sort(PreviousPoints);
plot(PreviousPoints);

The output of which is a graph I would like to add to them a point and make it visible.

If you have any way let me know

Upvotes: 0

Views: 1864

Answers (1)

Rex Kerr
Rex Kerr

Reputation: 167921

plot(1:length(PreviousPoints), PreviousPoints, newx, newy)

or

plot(PreviousPoints)
hold on
plot(newPt)
hold off

(hold on will keep plotting things on top of each other until you turn it off)

Upvotes: 2

Related Questions