exportgraphics overlay bug when saving

6 ビュー (過去 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 Center および File ExchangePrinting and Saving についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by