How to define the order of layers/plots and axes?
105 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have some plots: p1 = plot(...); p2 = scatter(...). p3 = line(..); p4 = fill(...), p5 = imagesc(...); etc.
How to do the following?
1) Initialize these plots in arbitrary order, but not draw them yet!
2) Define the order of them, I mean: associate layers to them (top, bottom, etc.)
3) Draw them at the same time, with the above defined order (maybe set transparency also)
4) After plotting has been performed, is it possible to update a single layer and replot it, but with the appropriate untouched layers above it?
Note: And what if I have overlapping axes? Is it possible to associate layers to axes too?
0 commentaires
Réponse acceptée
Matt J
le 29 Mai 2023
Modifié(e) : Matt J
le 29 Mai 2023
1) Hfig=figure('Visible','off); p(1) = plot(...); p(2) = scatter(...). p(3) = line(..); p(4) = fill(...), p(5) = imagesc(...)
2) Use the Children property of the plot axes set(gca,'Children', p([2,5,4,3,1[)
3) Hfig.Visible='on'. For transparency, you can set the FaceAlpha and MarkerFaceAlpha properties of those p(i) that have them. Line plots do not, however.
4) Use the XData and YData properties of p(i)
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Scatter Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!