Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to set font size in axis tick labels?

129 views
Skip to first unread message

Mark Proulx

unread,
Aug 21, 2008, 5:11:02 PM8/21/08
to
How do I set the font size in my axis tick labels? I've
set the "tick label mode" from 'auto' to 'manual,' but
haven't been able to get beyond this. I figure that if I
could find the handle value for the axis labels, I'd have
it made, but I can't figure out how to do this, either.

Walter Roberson

unread,
Aug 21, 2008, 7:05:14 PM8/21/08
to
Mark Proulx wrote:
> How do I set the font size in my axis tick labels?

Set the FontSize property of the axes.

>> plot(rand(1,20));set(gca,'FontSize',3)


--
Q = quotation(rand);
if isempty(Q); error('Quotation server filesystem problems')
else sprintf('%s',Q), end

Matt Fig

unread,
Aug 21, 2008, 7:06:01 PM8/21/08
to
The handles for the axis labels are stored in the 'xlabel'
property of the axes.

plot([1:10])
xlhand = get(gca,'xlabel')
set(xlhand,'string','X','fontsize',20)


Mark Proulx

unread,
Aug 21, 2008, 7:21:01 PM8/21/08
to
Walter Roberson <robe...@hushmail.com> wrote in message
<Kwmrk.101670$nD.18048@pd7urf1no>...

It worked great; huge thanks!

Mark

Mark Proulx

unread,
Aug 21, 2008, 7:22:02 PM8/21/08
to
"Matt Fig" <spam...@yahoo.com> wrote in message
<g8kscp$rvb$1...@fred.mathworks.com>...

Many thanks for the answer. While Walt's answer got me out
of my immediate difficulty, your answer gives me
information that will be useful in the long term!

Mark

Juliette Salexa

unread,
Jul 8, 2009, 4:32:19 PM7/8/09
to
How do we do this for only the x axis and NOT the y axis ??

TideMan

unread,
Jul 8, 2009, 5:27:30 PM7/8/09
to
On Jul 9, 8:32 am, "Juliette Salexa" <juliette.physic...@gmail.com>
wrote:

> How do we do this for only the x axis and NOT the y axis ??

Look at Matt Fig's post.
That shows you how to apply only to the x-axis.

Nathan

unread,
Jul 8, 2009, 5:29:52 PM7/8/09
to

Matt Fig's post applies to the Xlabel, not Xlabelticks, as I think
Juliette is wanting.
I almost said the same thing until I figured that out.

And sorry, I can't figure it out either.
-Nathan

Juliette Salexa

unread,
Jul 8, 2009, 5:45:03 PM7/8/09
to
Yes those methods listed above (trust me I've tried them all) only work for the xlabels, and for XTickLabels, modifying the fontsize modifies the YTickLabels fontsizes simultaneously.

There should be a way around this .. anyone know ??

Doug Schwarz

unread,
Jul 8, 2009, 6:06:43 PM7/8/09
to
In article <h3340v$rft$1...@fred.mathworks.com>,
"Juliette Salexa" <juliette....@gmail.com> wrote:

There is not. The property that controls both the XTickLabels and
YTickLabels is FontSize. The only thing you can do is create separate
text items and put them where you want the labels to go.

--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.

0 new messages