bring to front in dual plot
16 次查看(过去 30 天)
显示 更早的评论
In dual plot, how to bring the left plot to front, I try uistack but didn't work
9 个评论
dpb
2025-7-24
编辑:dpb
2025-7-25
@Adam Danz says "changing the child order can be a strategy for controling stacking order in general. "
Yeah, I learned about that from there having been a blog illustrating it at some distant time in the past; couldn't begin to say who or when, any more.
Your demo illustrates the point I made earlier about there being only one child/axes rather than multiple so that there isn't anything to sort/rearrange to affect stacking order.
My only thought was whether if one could apply the same concept to the axes order instead of lines it might just trigger a refresh of both axes.
dpb
2025-7-26
编辑:dpb
2025-7-26
yyaxis right
plot(1:5)
yyaxis left
plot(5:-1:1)
hAx=gca
hAx.YAxis
hAx.YAxis(1)==hAx.YAxis(2)
yyaxis is a special beastie, indeed; being one axes but with two selectable independent NumericRuler Y-axes.
For comparison, the venerable plotyy
x=1:5;
hAx=plotyy(x,flip(x),x,x)
hAx==gca
creates two completely independent axes, overlaying the second on top of the first.
Either way, there's no convenient way to change the stacking order; while one can
hAx=flip(hAx);
hAx==gca
and indeed, change the storage order ot the two axes since now the handle array is just a graphics object array like any other, that has no effect on the existing stacking order.
PS. I'm not sure what the warning is about; that doesn't happen locally, but I'm still with R2021b/R2022b here.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





