exportgraphics overlay bug when saving

조회 수: 4 (최근 30일)
Marine Fourrier
Marine Fourrier 2021년 10월 18일
답변: Richard Quist 2021년 11월 24일
Hello,
I'm using exportgraphics to save my figures in high quality. However they do not save in the same manner as they display.
I joined a screenshot of what the figure looks like when it's produced (before saving), and the purple star and red triangle are on top of all the other markers. I payed attention to the order with which I was plotting the different datasets to have them on top. However when I save the figure, the red triangle is behind the other markers. (see png of the screenshot and pdf of the saved figure).
Any ideas on why the display changes and how to fix it ?
Here is the line of code I use to save the figure
exportgraphics(fig,[REPS.rep_out,'fig_map.pdf'],'ContentType','vector','BackgroundColor','none')
Thanks a lot

답변 (1개)

Richard Quist
Richard Quist 2021년 11월 24일
I suspect you're seeing a difference in behavior between the painters renderer (used when generating "true vector" output when ContentType is 'vector') and the onscreen OpenGL renderer. Setting the onscreen figure renderer to painters will likely show the same issue, but then you can try adjusting the line to raise the marker up, perhaps by setting the ZData of the line that has the red marker

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by