Matlap plot- linspec features

plot(x,y,'-', 'color', cmap(jj,:));
Is there any way I can have matlab plot the data first and the use the linespec '-'?

Respuestas (1)

Steven Lord
Steven Lord el 30 de Jul. de 2018

0 votos

So you want to just call:
plot(x, y)
then change the plotted line to have a different line style or color? Call plot with an output, so you have a handle to the line, then change its properties.
x = 0:0.1:2*pi;
y = sin(x);
h = plot(x, y);
pause % So you can see how the plot looks before its properties change
h.Color = 'r';
See the documentation for a list of properties of the line that you can change.

Categorías

Más información sobre Line Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 30 de Jul. de 2018

Respondida:

el 30 de Jul. de 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by