Changing tick text on axis?

Ben Abbott bpabbott at mac.com
Fri Jul 18 06:02:07 CDT 2008


On Jul 18, 2008, at 6:25 AM, Wolfgang Schechinger wrote:

> Dear all,
>
> I have a bar chart where the groups of bars should have some labels  
> on the x axis instead of just numbers
>
> I tried this code (adopted from a matlab example):
>
> set(gca, 'xticklabelmode', 'manual')
> set(gca, 'xticklabel','|text1|text1|')
>
> but nothing happens
>
> get(gca,'xticklabel')
> retrieves '|text1|text1|', however!
>
> is this option not implemented in octave, or do I something wrong?
>
> Thanks,
>
> Wolfgang

I'm running 3.0.1 and the following works for me

octave:1> x = 0:200;
octave:2> plot (x)
octave:3> set (gca, 'xtick', [0 100 200])
octave:4> set (gca, 'xticklabel', {'zero', 'one hundred', 'two  
hundred'})
octave:5> get (gca, 'xticklabelmode')
ans = manual

Ben


More information about the Help-octave mailing list