Printing image to file with Matlab 2014b: resolution issue

4 views (last 30 days)
I am using the print function to save figures containing large images (geographical data) as jpg or tif images:
figure(1); imagesc(My_image); print('-r600', '-djpeg', '-f1', 'My_image.jpg');
This used to work perfectly for years with previous Matlab versions. Now with Matlab 2014b, the image keeps the screen resolution whatever dpi (here 600) number is chosen: the number of pixel is behaving as expected, but the image itself keeps the same pixels as displayed on the screen, resulting only in very large squares (pixels) when using large dpi numbers. To be clear: the image is simply not resampled according to the dpi number, as it should be. The other figure information such as axes, text, colorbar, ... are behaving correctly.
I tried to change the renderer, it did not change anything.
I tested the exact same code on Matlab 2014a and it worked perfectly there: the image resolution followed the selected dpi number. I tested it on another computer and had the same issue with Matlab 2014b.
What is going on? How can I save my figures with the appropriate resolution?

Answers (1)

spuler
spuler on 10 Apr 2015
I am seeing the same issue. I noticed that the imagesc figures display/load considerably faster in 2014b (and 2015a) compared to 2014a. Possible the resolution problem has something with the with a change to the imagesc call and not print. For now I have to use 2014a to generate high resolution images with the print command.

Categories

Find more on Graphics Object Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!