How to define the order of layers/plots and axes?

조회 수: 114 (최근 30일)
Merse Gaspar
Merse Gaspar 2023년 5월 29일
편집: Matt J 2023년 5월 29일
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?

채택된 답변

Matt J
Matt J 2023년 5월 29일
편집: Matt J 2023년 5월 29일
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개)

카테고리

Help CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by