octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Ben Abbott
Subject: Re: [changeset] - x/y/zticklabel as a numeric vector
Date: Sat, 15 Nov 2008 02:05:33 -0500


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


Attachment: changeset-xticklabel-num-vec.patch
Description: Binary data



reply via email to

[Prev in Thread] Current Thread [Next in Thread]