Axis tick labels changed upon export to EPS

10 次查看(过去 30 天)
Hi all,
Duplicate post from the discussion forum here:
because I think it's a reasonable question!
I am using Matlab R2010b.
I have manually changed the axis tick labels for some of my plots and am experiencing some weird behaviour.
I have saved the figures (.fig) and the axis tick marks are correct. I can export to PNG or PDF with no problems. When I export to EPS however the axis tick marks have been altered and are completely incorrect.
Fig file is here if you want to play with it:
Any ideas? Surely a bug if it is specific to EPS export?!
Thanks for any suggestions,
Gabriel
  1 个评论
Arnaud Miege
Arnaud Miege 2011-4-26
The figure exports fine to EPS on my machine. Do you have Ghostscript and Ghostview installed?

请先登录,再进行评论。

采纳的回答

Gabriel Rosser
Gabriel Rosser 2011-4-27
Fixed:
The problem with specifying your own axis tick labels is that the property (for the y-axis here) YTickLabelMode is set to manual but the property YTickMode remains at auto.
When exporting to EPS, for some very odd reason the figure must be slightly rescaled (which is not the case/the rescaling is different when choosing PDF or PNG). The tick positions are automatically reassigned, but the labels remain those specified manually. Result: unexpected and rubbish figures!
Setting the axis property YTickMode to manual fixes this.
Of course this is only a problem if the rescaling step causes the tick positions to change, so Oliver Woodford probably didn't observe this.
I still think this is buggy behaviour - why should one type of export cause figure resizing when another doesn't?
Thanks for your suggestions everybody!
  10 个评论
Olivier
Olivier 2024-11-13
I think the problem is solved when you set ylim manually.

请先登录,再进行评论。

更多回答(1 个)

Matt Fig
Matt Fig 2011-4-26
I only use this for exporting figures.
  5 个评论
Gabriel Rosser
Gabriel Rosser 2011-4-27
Oh sorry Oliver I just realised you mean you tried export_fig with my actual figure? That's very strange. Only difference I can think is I'm running Linux 64bit. Anyway, thanks very much for trying it and see my answer below for the fix.
Oliver Woodford
Oliver Woodford 2011-4-27
Yes, I was using your figure. Anyway, glad you found a solution. If I can replicate the bug I may put a fix into export_fig.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by