Function 'print' does not save properly in 'png' format. Title of the colorbar in a surf plot is missing (Matlab2015b on Mac OSX 10.9.5)
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
This code creates a figure to be exported/saved:
[X,Y,Z] = peaks(25);
hf = figure;
surf(X,Y,Z);
view(2)
cb = colorbar
set(get(cb,'title'),'string','MyTitle','fontsize',16)
On screen you should see this figure:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152671/image.png)
When the figure is saved using the command print, the title of the colorbar is missing. In fact, the following code
print(hf,'-dpng','-r300','MyFigure');
creates the figure 'MyFigure.png' that looks like:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152672/image.png)
The problem is experienced on:
- Matlab2015b
- Mac OSX 10.9.5
Any ideas, suggestions or solutions are welcome.
Luca
EDIT
The same code on a machine with Windows 10 works.
Maybe it is a bug only for Mac OS X systems.
0 Kommentare
Antworten (1)
Shruti Sapre
am 17 Dez. 2015
Hi,
I tried the above code and it displayed the title for me. You could maybe try switching to a basic version of hardware-accelerated OpenGL or update your drivers
-Shruti
Siehe auch
Kategorien
Mehr zu Graphics Performance finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!