Why do I get a black square when trying to print or export my image?

7 views (last 30 days)
I get a black square when trying to print or export my image.
Using one of the examples, at the command line I type the following commands
P = peaks(40);
C = del2(P);
surf(P,C)
colormap hot
Once the figure is plotted on the screen in the Figure Dialog, I go to
File->Save As->bmp (or File->Print). I save the file as test.bmp, but when I try to print it, I get a black square.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
Sometimes the renderer needs to be forced (depending on the graphics card). You can save the figure from the command line:
print -dbmp -opengl figuregl
In addition there are two other renders:
print -dbmp -zbuffer figurez
print -dbmp -painters figurep
where 'figuregl', 'figurez' and 'figurep' will be .BMP filenames. They will be saved in your current working directory.
This can also be done from the figure user interface:
File -> Page Setup -> Axes and Figures tab -> Figure Renderer (choose from the list box) -> OK, and then Save.

More Answers (0)

Categories

Find more on Display Image in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!