Info

This question is closed. Reopen it to edit or answer.

Export plot to pdf - Issues under OS X with R2014b

1 view (last 30 days)
Ingolf
Ingolf on 17 Nov 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
Hello!
I am currently struggling with pdf export under OS X Yosemite using Matlab R2014b. Especially plots that contain noisy data have a tendency to look fuzzy in the pdf. As far as I remember this did not happen with older Matlab versions (although I am not completely certain). When I run the following code:
x = 0:2500;
y = rand(1,2501)+100.*exp(-((x-1000)./50).^2);
fig = figure(567)
plot(x,y, 'Color', 'r')
size = [20 15];
set(fig, 'PaperUnits', 'centimeters')
set(fig, 'PaperSize', size)
set(fig, 'PaperPosition', [1 1 18 14])
file = 'plot_OSX.pdf'
print('-f 567', '-dpdf', file)
the output looks like shown in 'plot_OSX.pdf'. When I run the same code under Windows Server 2012 with Matlab R2012b, I get the result shown in 'plot_Windows.pdf' which looks much nicer.
Of course, it is a little unfortunate that I am only able to compare different operating systems as well as different Matlab versions.
However, I would be very thankful if somebody has a good advise how to create nice vector graphics with R2014b under OS X. The export to eps also creates the fuzzy artifacts and I would really like to circumvent using the bitmap graphics produced by the OpenGL renderer.
Thanks!
Best regards, Ingolf

Answers (2)

Luuk van Oosten
Luuk van Oosten on 17 Nov 2014
Hello Ingolf,
I have no experience with OS X but,
for a more fair comparison tried your code in Windows R2014a and it looks exactly like your plot_Windows.pdf. Could indicate that some settings are changed due to yosemite, but to be honest I have no idea. Have you tried saving your image in another format like .ai or .emf? Good luck!
  1 Comment
Ingolf
Ingolf on 17 Nov 2014
Hello Luuk,
thanks for your efforts. I already had the suspicion that my issue is caused by the behavior of OS X. Since I want to use the exported files mainly within LaTeX documents, a true vector graphic in .pdf or .eps would be the most preferable format. As .emf is a proprietatary Microsoft format, I doubt that it is even possible to use it under OS X. And the option to export to .ai does neither exist under my OS X nor under my Windows instance of Matlab. Furthermore, I guess .ai would be only of use if I had a license for Illustrator...?

Stefan Heidenblut
Stefan Heidenblut on 26 Jan 2015
Hello Ingolf,
for MATLAB R2014b in Windows 7 it's the same problem. I think it's connected to the new graphics engine introduced in R2014b. I wrote a service request and wait for an answer.
  1 Comment
Stefan Heidenblut
Stefan Heidenblut on 27 Jan 2015
The answer from MATLAB Technical Support:
This is a known issue in MATLAB R2014b. Our developers are working on the issue and it will be fixed in future releases.
For now we recommend keeping the line thickness at the default value and/or reducing the density of the data.

Products

Community Treasure Hunt

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

Start Hunting!