Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Font Properties in Figure Window

Subject: Font Properties in Figure Window

From: Alexandra

Date: 18 Jan, 2011 10:43:05

Message: 1 of 8

After (unsuccessfully) trying to change the font properties of my plots for quite some time, I finally surrendered and tried to do it by hand (with plot tools). But even there it doesn't work. The only thing I can change is the color, but no size or style.
I can change the fonts in the Editor, etc, so it's not a problem of the fonts themselves. Is there any global setting, I have missed?

P.S.: I am running 2010b on Ubuntu

Subject: Font Properties in Figure Window

From: Andy

Date: 18 Jan, 2011 14:08:04

Message: 2 of 8

"Alexandra" wrote in message <ih3qrp$jsq$1@fred.mathworks.com>...
> After (unsuccessfully) trying to change the font properties of my plots for quite some time, I finally surrendered and tried to do it by hand (with plot tools). But even there it doesn't work. The only thing I can change is the color, but no size or style.
> I can change the fonts in the Editor, etc, so it's not a problem of the fonts themselves. Is there any global setting, I have missed?
>
> P.S.: I am running 2010b on Ubuntu

Could you describe more precisely what you're trying to do and what you've already tried that didn't work? It sounds like you're trying to adjust the font properties of the x and y labels. Is that correct? If so, the following works fine for me:


x=linspace(0,10,100);
y=sin(x);
plot(x,y);
xlabel('This is the X label')
ylabel('This is the Y label','FontSize',24,'FontName','Arial',...
    'FontAngle','italic','Color','white');

Subject: Font Properties in Figure Window

From: Alexandra

Date: 19 Jan, 2011 10:42:04

Message: 3 of 8

"Andy" wrote in message <ih46s4$g7m$1@fred.mathworks.com>...
> "Alexandra" wrote in message <ih3qrp$jsq$1@fred.mathworks.com>...
> > After (unsuccessfully) trying to change the font properties of my plots for quite some time, I finally surrendered and tried to do it by hand (with plot tools). But even there it doesn't work. The only thing I can change is the color, but no size or style.
> > I can change the fonts in the Editor, etc, so it's not a problem of the fonts themselves. Is there any global setting, I have missed?
> >
> > P.S.: I am running 2010b on Ubuntu
>
> Could you describe more precisely what you're trying to do and what you've already tried that didn't work? It sounds like you're trying to adjust the font properties of the x and y labels. Is that correct? If so, the following works fine for me:
>
>
> x=linspace(0,10,100);
> y=sin(x);
> plot(x,y);
> xlabel('This is the X label')
> ylabel('This is the Y label','FontSize',24,'FontName','Arial',...
> 'FontAngle','italic','Color','white');

Yes, I am trying to change the font properties of axes, labels, title, legend, etc; but let's say just the labels for simplicity.
Your line is one of the things I have tried; another thing is set(gca, 'FontSize', 24). After this didn't work, I tried to change the font by hand with the plot tools; this also didn't work - the only property I was able to change was the color - the font stayed on monospace. I tried my code on another computer, and everything worked fine, so that's not it.
Either I have some global setting, which makes matlab ignore all my attempts, or matlab somehow cannot access the fonts, which I find unlikely, since I can change fonts in other windows.

Subject: Font Properties in Figure Window

From: Andy

Date: 19 Jan, 2011 13:48:05

Message: 4 of 8

"Alexandra" wrote in message <ih6f5s$sup$1@fred.mathworks.com>...
> "Andy" wrote in message <ih46s4$g7m$1@fred.mathworks.com>...
> > "Alexandra" wrote in message <ih3qrp$jsq$1@fred.mathworks.com>...
> > > After (unsuccessfully) trying to change the font properties of my plots for quite some time, I finally surrendered and tried to do it by hand (with plot tools). But even there it doesn't work. The only thing I can change is the color, but no size or style.
> > > I can change the fonts in the Editor, etc, so it's not a problem of the fonts themselves. Is there any global setting, I have missed?
> > >
> > > P.S.: I am running 2010b on Ubuntu
> >
> > Could you describe more precisely what you're trying to do and what you've already tried that didn't work? It sounds like you're trying to adjust the font properties of the x and y labels. Is that correct? If so, the following works fine for me:
> >
> >
> > x=linspace(0,10,100);
> > y=sin(x);
> > plot(x,y);
> > xlabel('This is the X label')
> > ylabel('This is the Y label','FontSize',24,'FontName','Arial',...
> > 'FontAngle','italic','Color','white');
>
> Yes, I am trying to change the font properties of axes, labels, title, legend, etc; but let's say just the labels for simplicity.
> Your line is one of the things I have tried; another thing is set(gca, 'FontSize', 24). After this didn't work, I tried to change the font by hand with the plot tools; this also didn't work - the only property I was able to change was the color - the font stayed on monospace. I tried my code on another computer, and everything worked fine, so that's not it.
> Either I have some global setting, which makes matlab ignore all my attempts, or matlab somehow cannot access the fonts, which I find unlikely, since I can change fonts in other windows.

Well, the fact that it works correctly on other computers suggests that the problem is your installation of Matlab. I suggest you contact technical support.

Subject: Font Properties in Figure Window

From: Matt

Date: 14 Feb, 2011 22:56:03

Message: 5 of 8

"Alexandra" wrote in message <ih3qrp$jsq$1@fred.mathworks.com>...
> After (unsuccessfully) trying to change the font properties of my plots for quite some time, I finally surrendered and tried to do it by hand (with plot tools). But even there it doesn't work. The only thing I can change is the color, but no size or style.
> I can change the fonts in the Editor, etc, so it's not a problem of the fonts themselves. Is there any global setting, I have missed?
>
> P.S.: I am running 2010b on Ubuntu

I am having the same issue with my copy of 2010b. It worked fine on my previous copy of 2008b. For example if I run the following code it has no effect on the figure.

set(get(gca,'title'),'FontSize',40)

but if I do a

get(get(gca,'title'))
it shows the fontSize at 40.

This command worked for me no problems and would visually change the title fontsize until I moved to 2010b. Could it be a bug in 2010b or did they add new feature? - matt

Subject: Font Properties in Figure Window

From: blot

Date: 12 Apr, 2011 03:26:05

Message: 6 of 8

Hi folks!

Did you find the solution for this problem?

I actually experiment the same issue but with matlab2007b running under Ubuntu 11.04(beta1). It was the same problem with Maverick but I can't modify the police properties only for 3d plots. I suspect something wrong with Java because for some plots Matlab crash with some errors linked to Java...

Thanks

Subject: Font Properties in Figure Window

From: Jason

Date: 12 Jul, 2011 02:38:10

Message: 7 of 8

I have this same problem with Ubuntu 11.04 and Matlab 2011a.

Any solutions?

If I change the font size to 14 (for example), and then do a get(gca) it lists the font size as 14, but there is no change on the actual figure.

"blot " <blot.romain@gmail.com> wrote in message <io0god$4iq$1@fred.mathworks.com>...
> Hi folks!
>
> Did you find the solution for this problem?
>
> I actually experiment the same issue but with matlab2007b running under Ubuntu 11.04(beta1). It was the same problem with Maverick but I can't modify the police properties only for 3d plots. I suspect something wrong with Java because for some plots Matlab crash with some errors linked to Java...
>
> Thanks

Subject: Font Properties in Figure Window

From: Jason

Date: 12 Jul, 2011 02:49:10

Message: 8 of 8

Ok so a bit more googling and I found the solution. See the ubuntu forums here:
http://ubuntuforums.org/showthread.php?t=1762805

Essentially you need to install some missing fonts in 11.04.
sudo apt-get install xfonts-75dpi
sudo apt-get install xfonts-75dpi

Then logout and back in. It now appears to work

Tags for this Thread

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.

Contact us