How to plot stair like this??

2 visualizaciones (últimos 30 días)
Vannapong Klungthong
Vannapong Klungthong el 15 de Nov. de 2021
Comentada: Vannapong Klungthong el 16 de Nov. de 2021
onlyPlot =[ 95 143
91 289
91 427
77 551
77 671]
x=[onlyPlot(:,2)];
y=[onlyPlot(:,1)];
stairs(x,y,'LineWidth',2,'Marker','o','MarkerFaceColor','c');
axis([0,700,76,96])

Respuesta aceptada

Jon
Jon el 15 de Nov. de 2021
Editada: Jon el 15 de Nov. de 2021
I think this does what you want and is nice and simple
X = [95 0;onlyPlot]
stairs(flip(X(:,2)),flip(X(:,1)),'-o')
  2 comentarios
Jon
Jon el 15 de Nov. de 2021
Editada: Jon el 15 de Nov. de 2021
Although I guess it doesn't put the markers as you show them. I'm not sure if that is important for you or you just want the jumps as you show them. If you just want the jumps but don't need the markers can use line type '-' and not plot the markers
Vannapong Klungthong
Vannapong Klungthong el 16 de Nov. de 2021
Thanks a lot it solve my problem clearly

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Annotations en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by