exportgraphics overlay bug when saving

4 visualizaciones (últimos 30 días)
Marine Fourrier
Marine Fourrier el 18 de Oct. de 2021
Respondida: Richard Quist el 24 de Nov. de 2021
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

Respuestas (1)

Richard Quist
Richard Quist el 24 de Nov. de 2021
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

Categorías

Más información sobre Printing and Saving en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by