Image quality degrades when using incrementally bigger mesh

1 view (last 30 days)
I am trying to make an image containing multiple plots (I'm using subplot). One of the plots is a mesh(). Then I use print() to make an EPS file.
When I make the arrays inputted into mesh 90x337 everything looks fine. But when I make them 90x338, everything messes up...quality is degraded, e.g., tick labels are no longer arbitrarily smooth as I zoom in (as vector graphics should)...if I use Latex as the interpreter, suddenly some letters in axis labels become subscripts...everything looks grainy. The threshold is even worse for the Figure plot than for the exported image file.
I don't think this is a filetype issue (raster vs. vector) as the same problem seems to occur for TIFFs and PNGs. I have tried specifying use of Painters. I have tried deleting large arrays right before calling mesh() to try to free up memory but that doesn't solve it. I've tried "opengl neverselect."
When I don't plot the mesh but I continue to make my other lineplots etc. in the figure, all is well...the issue appears to be related to the amount of data being plotted by mesh().
I have tried all the basic things I believe and am a pretty experienced MATLAB user, but I am going nuts. I'm using Fedora Linux...I have a feeling this wouldn't happen in e.g. Windows.
BTW, I definitely need much higher mesh resolution than 90x337 because I am plotting spectra with particular linewidths and spacings. And even if I didn't care about that I need higher resolution simply to increase the image quality (this is for a publication, hopefully).
Any help would be incredibly appreciated. Thanks in advance!
--Andrew

Accepted Answer

Image Analyst
Image Analyst on 8 Apr 2013
Sounds like an aliasing issue to me. Why not make them all a lot bigger like 4 times as big, and put them into your paper/document separately instead of using subplot?
  1 Comment
Andrew
Andrew on 11 Apr 2013
Thanks Image Analyst. It's a frustrating issue but your idea should work.
BTW, contrary to what I originally guessed, this also failed to work in Windows.

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 8 Apr 2013
  3 Comments
Malcolm Lidierth
Malcolm Lidierth on 11 Apr 2013
@Andrew
It sounds to me that this is a problem with the software you are using to process/view the MATLAB eps output. Try viewing the eps file from MATAB in a decent previewer/print it at different sizes). Examine the file content. Is it vector output?MATLAB might switch to embedding an image with multiple axes I guess but I am not aware of any docs on that.
As IA says, it looks like aliasing (with height 337 vs 338 making a difference -odd vs even- that suggests some pretty basic resampling algorithms are being applied). Is your post-MATLAB processing converting EPS to bitmap?
ML
Andrew
Andrew on 7 May 2013
Hi Malcolm,
Thanks so much for your fast reply and I apologize for the delay in mine.
Unfortunately, it does not work in a different viewer...the problem even occurs in Windows, though the cutoff (337 pixels) seems to be different. (BTW, the problem does occur with e.g. 339 pixels even though it's odd.) It looks bad even when MATLAB plots the original graphic before it writes to EPS, and I'm certainly not converting the EPS image to bitmap. It is indeed vector graphics...from what I can tell the EPS file is saved with the vectors representing the bad image.
Anyway, thanks very much again for your reply. I'm hoping Mathworks will improve its high-resolution 3D printing quality but until then I'll keep an eye on your Waterloo project.
Thank you,
Andrew

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!