XData and YData from area chart
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Chad Greene
el 2 de Nov. de 2021
Comentada: Star Strider
el 2 de Nov. de 2021
I'm using the area function to create a stacked area chart of hundreds of time series. After plotting my data via
h = area(t,Y);
I'd like to access the coordinates of all of the filled areas using
h(1).XData
h(1).YData
however, I'm surprised to find that h.XData and h.YData return the input data I gave it (time,Y) rather than the coordinates of the plotted objects.
Is there a way to access the plotted coordinates of the filled objects?
0 comentarios
Respuesta aceptada
Star Strider
el 2 de Nov. de 2021
Add (cumsum) ‘Y’ row-wise to get the coordinates —
t = 1:10;
Y = randi(9, 10, 3)
Ycoordinates = cumsum(Y,2)
figure
h = area(t,Y);
grid
.
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!