axis manipulations in plots are unnecessarily restrictive
John W. Eaton
jwe at bevo.che.wisc.edu
Thu Mar 6 15:05:11 CST 2008
On 6-Mar-2008, Rob Mahurin wrote:
| On Mar 6, 2008, at 1:22 PM, John W. Eaton wrote:
|
| > On 6-Mar-2008, Rob Mahurin wrote:
| >
| > | The change to "graphics handle" plot manipulation has made some
| > | tweaks to gnuplot's default axes impossible. I have (somewhat)
| > | rewritten them in the new language and would be glad to see them
| > | officially supported in a later version of Octave.
| >
| > | # eliminate the tics, but keep the box
| > | set(gca,"visible","lines");
| >
| > Try
| >
| > set (gca, "xtick", [], "ytick", []);
| >
| > instead.
|
| That's half of what I want. But I more frequently use tics without
| lines (see attached example). Is there a way to do that, apart from
| my patch?
I don't see a way at the moment. Is there a way to do it with Matlab?
If so, then we should use that method rather than inventing something
different. If not, then to support it we would need to decide what
property should be used for this purpose.
| I understand that, and I'd expect that in the long term such an
| option would be implemented entirely by Octave --- that is, a call like
|
| set(gca,"xticklabels","%.3f","formatpercents","true")
I think the Matlab way of doing this would be
xtick = get (gca, 'xtick');
n = numel (xtick);
xticklabel = cell (1, n);
for i = 1:n
xticklabel{i} = sprintf ('%.3f', xtick(i));
end
set (gca, 'xticklabel', xticklabel);
You could of course package this in a function to reduce typing, so
I'm not sure it is necessary to have new special purpose properties.
Note also that this method is more flexible because you are not forced
to have all numeric labels.
Unfortunately this doesn't quite work in Octave yet because we still
leave the calculation of the tick locations to gnuplot, though that
will eventually change.
jwe
More information about the Bug-octave
mailing list