Vector plots, pcolor, MATLAB, and you

I make most of my figures in MATLAB, using the print -depsc command. This generates lovely, vectorized figures for most incantations of plot and its cousins, but annoyingly returns bitmap graphics if you use that command on plots involving pcolor. If you want vectorized .eps files with your colormap rendered nicely rather than .eps figures containing bitmaps, use the -painters flag (it’s a type of Renderer) while printing (thanks, MATLAB Central):

print -depsc -painters file.eps

Now that you have a vector image containing your colormap information, it’s time to display your figure. On some systems, your PS/PDF renderer will insert some crisscrossing white lines while rendering your vectorized image. However, you can usually turn off anti-aliasing on your viewer and you should be to witness your glorious figures sans white crosshatching (again, thanks to MATLAB Central).

Sure, I could probably tackle these problems in Adobe Illustrator or Inkscape, but I like having things work properly on the first go when it comes to creating figures and otherwise minimizing the number of non-automated steps in my image-creation workflow.

(PS: a draft of my thesis is available here.)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.