How to define the order of layers/plots and axes?
115 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Merse Gaspar
el 29 de Mayo de 2023
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 comentarios
Respuesta aceptada
Matt J
el 29 de Mayo de 2023
Editada: Matt J
el 29 de Mayo de 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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Scatter Plots 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!