XData and YData from area chart
9 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Star Strider
2021-11-2
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
.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!