Got Questions? Get Answers.
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:
figure font

Subject: figure font

From: Misha Koshelev

Date: 12 Jun, 2009 19:44:02

Message: 1 of 4

Hi, I apologize if this is a dumb question - I would like to set the font size for the legend and axes of a figure. How do I do this?

Thank you
Misha

Subject: figure font

From: David T

Date: 12 Jun, 2009 20:26:02

Message: 2 of 4

Not a dumb queston.
simplest way i got this to work...
Example
C = magic(6)
axes('Fontsize',14)
hold on
contour(C)

The legend uses the same properties as the axis.
Definitely not the best way but it works, I hope this helps some.

"Misha Koshelev" <mk144210@bcm.edu> wrote in message <h0ub62$l0p$1@fred.mathworks.com>...
> Hi, I apologize if this is a dumb question - I would like to set the font size for the legend and axes of a figure. How do I do this?
>
> Thank you
> Misha

Subject: figure font

From: someone

Date: 12 Jun, 2009 20:30:04

Message: 3 of 4

"Misha Koshelev" <mk144210@bcm.edu> wrote in message <h0ub62$l0p$1@fred.mathworks.com>...
> Hi, I apologize if this is a dumb question - I would like to set the font size for the legend and axes of a figure. How do I do this?
>
> Thank you
> Misha

% From
doc legend

% "The font size and font name for the legend strings match the axes FontSize and FontName properties." So, if the plot is you current plot,

set(gca,'FontSize',n)

% where n is the Font size specified in FontUnits which is in points by default. See
doc axes
% and how to set those properties.

Subject: figure font

From: Misha Koshelev

Date: 12 Jun, 2009 22:57:01

Message: 4 of 4

"someone" <someone@somewhere.net> wrote in message <h0udsc$htf$1@fred.mathworks.com>...
> "Misha Koshelev" <mk144210@bcm.edu> wrote in message <h0ub62$l0p$1@fred.mathworks.com>...
> > Hi, I apologize if this is a dumb question - I would like to set the font size for the legend and axes of a figure. How do I do this?
> >
> > Thank you
> > Misha
>
> % From
> doc legend
>
> % "The font size and font name for the legend strings match the axes FontSize and FontName properties." So, if the plot is you current plot,
>
> set(gca,'FontSize',n)
>
> % where n is the Font size specified in FontUnits which is in points by default. See
> doc axes
> % and how to set those properties.

Thanks. Btw it does not seem to quite refit the legend box to the font. Any hints?

Thanks
Misha

Tags for this Thread

No tags are associated with 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