From: Sergio on
Hello everyone,

I've plotted several graphics and now I need to change their font sizes. I've managed to do it for the Xlabel and Ylabel.

However, I'm having some trouble when I try to change XTickLabels and YTickLabels font sizes.

Here's my code :

(I open a figure)

set(gca,'XTickLabel','FontName','Times','fontsize',18)
set(gca,'YTickLabel','FontName','Times','fontsize',18)

and this is the error message I get:

??? Error using ==> set
Conversion to double from cell is not possible.

Thanks for your help
From: Wayne King on
"Sergio " <sketter2(a)zipmail.com.br> wrote in message <i2u7nc$7qf$1(a)fred.mathworks.com>...
> Hello everyone,
>
> I've plotted several graphics and now I need to change their font sizes. I've managed to do it for the Xlabel and Ylabel.
>
> However, I'm having some trouble when I try to change XTickLabels and YTickLabels font sizes.
>
> Here's my code :
>
> (I open a figure)
>
> set(gca,'XTickLabel','FontName','Times','fontsize',18)
> set(gca,'YTickLabel','FontName','Times','fontsize',18)
>
> and this is the error message I get:
>
> ??? Error using ==> set
> Conversion to double from cell is not possible.
>
> Thanks for your help

Hi Sergio, Are you just trying to change the font size of the labels on the axis, or are you trying to change the actual labels themselves?

If you're just trying to change the font size.

plot(randn(100,1));
set(gca,'fontsize',14);

Wayne
From: Sergio on
"Wayne King" <wmkingty(a)gmail.com> wrote in message <i2u9fk$rm1$1(a)fred.mathworks.com>...
> "Sergio " <sketter2(a)zipmail.com.br> wrote in message <i2u7nc$7qf$1(a)fred.mathworks.com>...
> > Hello everyone,
> >
> > I've plotted several graphics and now I need to change their font sizes. I've managed to do it for the Xlabel and Ylabel.
> >
> > However, I'm having some trouble when I try to change XTickLabels and YTickLabels font sizes.
> >
> > Here's my code :
> >
> > (I open a figure)
> >
> > set(gca,'XTickLabel','FontName','Times','fontsize',18)
> > set(gca,'YTickLabel','FontName','Times','fontsize',18)
> >
> > and this is the error message I get:
> >
> > ??? Error using ==> set
> > Conversion to double from cell is not possible.
> >
> > Thanks for your help
>
> Hi Sergio, Are you just trying to change the font size of the labels on the axis, or are you trying to change the actual labels themselves?
>
> If you're just trying to change the font size.
>
> plot(randn(100,1));
> set(gca,'fontsize',14);
>
> Wayne

Hi

I've managed to change everything now. For the XTickLabels, i did:

a = get(gca,'XTickLabel');
set(gca,'XTickLabel',a,'FontName','Times','fontsize',18)

and it works...