Matlab barchart question.

2 Ansichten (letzte 30 Tage)
Pappu Murthy
Pappu Murthy am 10 Mai 2021
Beantwortet: SAAD am 4 Jul. 2023
I get this strange error (screen shot attached) when I save the figure as ".emf", or ".bmp" but no error at all when I tried to save as ".png". This error never showed up for me before. Please help. Thanks.

Akzeptierte Antwort

Asvin Kumar
Asvin Kumar am 13 Mai 2021
Hi Pappu,
It seems you've contacted Tech Support via email. I'll capture the workaround that we provided you over here for everyone else's reference.
The mentioned hgexport error shows up in both R2020b and R2021a. Here are two workarounds:
1. Try saving the figure in other formats such as PNG, if that works for you.
2. Explicitly set the figure's renderer to OpenGL before saving it. This would force the file to show an embedded image. This embedded image won't scale/resize as well as the other EMF files but it will allow you to use the same format. Run the following line before saving the figure to set the renderer for the current figure:
set(gcf, 'renderer', 'opengl')
  1 Kommentar
Pappu Murthy
Pappu Murthy am 13 Mai 2021
Thanks for the work around. It did fine so far for me.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

SAAD
SAAD am 4 Jul. 2023
if true
  % code
end

Community Treasure Hunt

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

Start Hunting!

Translated by