Figures displaying differently in and out of MATLAB

My figures are displaying differently in and out of MATLAB. I saved an image as an uncompressed TIF: -
and a screenshot after I imported it into Mathematica (shown at actual size): - https://dl.dropbox.com/u/11341635/Screen%20shot%202012-11-04%20at%2012.14.40.png
and a screenshot of the PDF generated from Mathematica by printing to PDF: - https://dl.dropbox.com/u/11341635/Screen%20shot%202012-11-04%20at%2012.14.46.png
a screen shot of the actual tif after it was opened in preview is here: - https://dl.dropbox.com/u/11341635/Screen%20shot%202012-11-04%20at%2012.28.10.png
I've found that I have to make the line thickness really fat so that they're properly visible after they're saved as whatever file type (jpeg, png, tif, uncompressed tif).
Does anyone have any advice or tips on getting there figures to look good i.e. no blurring or pixelation.
[EDITED, Jan, converted URLs to links]

4 Comments

You forgot to explain which function you use for exporting the TIFF. SAVEAS, IMWRITE, export_fig, PRINT, or manually in the menu of the figure? "No blurring or pixelation" is relative: When you export the TIFF with a resolution of 1200 dpi, you will not see a pixelation when printed on a laser printer.
Please explain what you are doing and what you want with more details.
You going to edit away your question later ?
Jan Simon - Sorry, I didn't actually know about all of the options - I just thought saving while looking at the figure was the only way of creating a graphic. So to answer you - I used SAVEAS. I now know what the export_fig and print options are, but I'm not sure what the IMWRITE and manually in the menu of the figure are.
My main problem is with blurred images. I usually don't have to print things out physically - just to PDF. I export images from MATLAB then import them into Mathematica and export to PDF from there. I've also tried using Word but the blurring is still there.

Sign in to comment.

 Accepted Answer

In order to preserve appearance, you could use a vector graphics format, such as .svg or .eps, instead of .png which is a bitmap.
Also make sure you are using the right renderer if you go the vector graphics route (look at "Selecting a renderer" from the documentation). You should use Painters for vector formats.
How your bitmap looks like depends on a lot of things, the renderer, the resolution, etc... It can be a pain to deal with.

6 Comments

Using Painters as Renderer and exporting to an EPS file is the most promising way. +1
Hi, thanks for that - I've tried saving my figure as an EPS and opening that in photoshop looks so much better already.
I've had a look into using painters, but I don't really know what that is. Can you give me an example?
FigH = figure('Renderer', 'Painters');
plot(1:10);
print(FigH, '-depsc2', 'TestPainters.eps');
set(FigH, 'Renderer', 'OpenGL');
print(FigH, '-depsc2', 'TestOpenGL.eps');
set(FigH, 'Renderer', 'ZBuffer');
print(FigH, '-depsc2', 'TestZBuffer.eps');
Okay I just get a y = x plot when I try that code. Am I supposed to be doing bits of it at a time and comparing the result? They all seem the same.
The top line - I've come across figure(1), figure(2) etc. but not figure('Renderer', 'Painters'); What's the point in the (1) and (2) then?
They are the same graphs, but the actual image files you get are different. Zoom in the different plots and you might see the difference (pixelation and aliasing in the bitmap renderers, OpenGL and ZBuffer).
The point is to illustrate the differences between the different renderers. figure(1), creates a figure whose handle is the number 1. figure(2) creates a different figure (with handle 2).
figure('Renderer','Painters')
Creates a figure whose "Renderer" property is set to "Painters". I'd recommend you read "Figure" and "Figure Properties" from the documentation. You might want to look into the difference between vector graphics and bitmaps.
Thank you very much Jose and Jan - much appreciated.

Sign in to comment.

More Answers (0)

Categories

Find more on Printing and Saving in Help Center and File Exchange

Products

Asked:

Tom
on 4 Nov 2012

Community Treasure Hunt

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

Start Hunting!