Thread Subject: Ugly axis labels on Mac

Subject: Ugly axis labels on Mac

From: Cristina

Date: 31 Jan, 2008 19:46:02

Message: 1 of 4

I've just started using MatLab R2007a Student Version on Mac OS X (Tiger) and I
have problems with plots. This code produces very bad looking labels on the
axis (on screen and when printing):

x = [0:10];
plot(x);
xlabel('\phi(\tau)');
ylabel('\phi(\tau)');

I had no problems with the same code on Windows. Any advice?

Subject: Ugly axis labels on Mac

From: Lorenzo

Date: 2 Feb, 2008 20:03:02

Message: 2 of 4

"Cristina " <canavesi@optics.rochester.edu.mapson> wrote in message
<fnt8hq$5k4$1@fred.mathworks.com>...
> I've just started using MatLab R2007a Student Version on Mac OS X (Tiger)
and I
> have problems with plots. This code produces very bad looking labels on
the
> axis (on screen and when printing):
>
> x = [0:10];
> plot(x);
> xlabel('\phi(\tau)');
> ylabel('\phi(\tau)');
>
> I had no problems with the same code on Windows. Any advice?

Hi Cristina,
yes, the default figure labeling on a Mac is quite ugly. Two things you can do:
1. change the default font size/type to something nicer (eg 12 points); you
can do this by inserting the line(s)
>>set(0,'defaultTextFontSize',12)
>>set(0,'defaultTextFontFace','Arial')
in the startup.m file (it's a file in the Matlab path that gets executed at
startup)

2. when using the figure in a document, do NOT copy and paste, but rather
create a file; the best format for printing is EPS. The following lines of code
get the job done nicely:

>>set(gcf,'paperPositionMode','auto') % make the print as big as the figure
>>print(gcf, '-depsc2', 'myPic.eps') % create EPS (help print for details)

Use another format, such as png or tiff, for bitmap figures (for example for
presentations):
>>set(gcf,'paperPositionMode','auto') % make the print as big as the figure
>>print(gcf, '-dpng','-r300', 'myPic.png') % create PNG at 300dpi (help print
for details)

If you put these instructions in a script or in a shortcut, it's almost as fast as
copy and paste... (I have a script which resizes the figure and change the
fonts before creating the file, so all my figures are uniformly formatted).

Also, for equations and other symbols, you can get better results using the
LaTeX interpreter instead of the standard TeX. Your figure looks much better
like this:
>> x = [0:10];
>> plot(x);
>> xlabel('vertical: $\phi(\tau)$','interpreter','LaTeX'); % notice the $ $
>> ylabel('horizontal: $\phi(\tau)$','interpreter','LaTeX');

Hope this helps,
Lorenzo

Subject: Ugly axis labels on Mac

From: Cristina

Date: 8 Feb, 2008 21:08:02

Message: 3 of 4

"Lorenzo " <lorenz4matlab@gmail.com> wrote in message
> Also, for equations and other symbols, you can get better results using the
> LaTeX interpreter instead of the standard TeX. Your figure looks much better

Lorenzo, thanks a lot for your help. The LaTeX interpreter did the trick. No way
to solve the issue using a different font or creating an EPS file though.

Subject: Ugly axis labels on Mac

From: Mikhail

Date: 15 Jul, 2008 22:19:02

Message: 4 of 4

Hi Lorenzo,

maybe you can help me too. All the text in my figures looks ugly on my mac
osx 10.5.4. In windows or linux it looks good without any modifications you
mention above.

Why does it look so bad on a mac and how can it be solved without having to
change fonts, sizes, interpreters?

These are the commands I use:

title(title_string, 'Interpreter', 'none')
ylabel('\zeta_{ani} (ppm)');
xlabel('\delta_{iso} (ppm)');

text(coordinate(1,1),coordinate(1,2), string,'FontSize',8,'Color',[0 0 1])

Thanks
Mikhail

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
font mac ugly f... Mikhail 15 Jul, 2008 18:20:26
axis label Cristina 31 Jan, 2008 14:50:20
plot Cristina 31 Jan, 2008 14:50:20
mac Cristina 31 Jan, 2008 14:50:20
rssFeed for this Thread

Contact us at files@mathworks.com