[changeset] - x/y/zticklabel as a numeric vector

Ben Abbott bpabbott at mac.com
Sat Nov 15 01:05:33 CST 2008


On Nov 3, 2008, at 7:08 PM, Ben Abbott wrote:

>
> On Nov 3, 2008, at 6:28 PM, Ben Abbott wrote:
>
>> I noticed that Octave does not allow
>>
>> 	set (gca, 'xticklabel', get (gca, 'xtick'))
>>
>> while Matlab does.
>>
>> Changeset for a trivial solution is attached.
>>
>> Ben
>>
>> <changeset-xticklabel-num-vec.patch>
>
>
> This should work as well.
>
> 	axes
> 	set (gca, 'xtick', 0:0.2:1)
> 	set (gca, 'xticklabel', num2str(get (gca, 'xtick')(:)))
>
> Changeset attached.
>
> Ben
>
> <changeset-xticklabel-num-vec.patch>

As this change has not been committed yet, I revisited this after  
David's recent changeset for "minortick" to the __go_draw_axes__.m to  
verify it would still work. As a result I found some sloppiness on my  
part .... so one more time.

In any event, this changeset permits the following to work

figure (1)
plot (1:10)
set (gca, "xtick", 0:2:10)
title ('Auto xticklabel')
pause
set (gca, "xticklabel", [0 1 3 6 8 9 10])
title ('set (gca, "xticklabel", [0 1 3 6 8 9 10])')
pause
set (gca, "xticklabel", [6 9])
title ('set (gca, "xticklabel", [6 9])')
pause
set (gca, "xticklabel", [1:100])
title ('set (gca, "xticklabel", [1:100])')
pause
set (gca, "interpreter", "tex")
set (gca, "xticklabel", ["\\alpha"; "\\beta "])
title ('set (gca, "xticklabel", ["\\alpha"; "\\beta "])')

The first three example are each consistent with Matlab and the last  
respects the recent functionality added to Octave (allowing the axes  
to have an interpreter).

Ben


-------------- next part --------------
A non-text attachment was scrubbed...
Name: changeset-xticklabel-num-vec.patch
Type: application/octet-stream
Size: 1830 bytes
Desc: not available
Url : https://www-old.cae.wisc.edu/pipermail/octave-maintainers/attachments/20081115/111967e3/attachment.obj 
-------------- next part --------------



More information about the Octave-maintainers mailing list