[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: revised: How to set xtics in 2-D plot in Octave 3.0.0 on a PC with W
Re: revised: How to set xtics in 2-D plot in Octave 3.0.0 on a PC with Windows Vista
Wed, 27 Feb 2008 19:25:05 -0500
On Feb 27, 2008, at 5:36 PM, Mr. E wrote:
I have been using the __gnuplot_set__ xtics command
for a long time to set non-uniform ticks on the x
axis, particularly handy in marking x-intercepts.
The new version of Octave 184.108.40.206 does not support
this method. Does anyone know how to do this?
here is a sample program that I have used for many
years to teach xtic setting:
axis([xmin xmax ymin ymax]);
__gnuplot_set__ xtics ( "Pi/4" pi/4, "Pi/2" pi/2, "Pi"
1.5*pi, "2*Pi" 2*pi )
I already tried the suggestion on my PC Windows Vista
with Octave 3.0.0 installation, and the
set (gca, "xtick", [pi:pi/2:2*pi]);
command does not change the default tickmarks.
I am a teacher at a small college, and it would really
help my students label their graphs and check handwork
if I could get the NON-uniform tick setting working
Any suggestions welcome.
ps. My question does not appear on the octave help
page... how can I post this question there for
everyone to see?
Please reply to address@hidden
google has good spam filtering!
I'm running 3.0.0+
This works for me in Octave and Matlab
x = linspace (0, 2*pi, 201);
y = sin (x);
xtick = 0:0.5:2.0;
xticklabel = num2str (xtick');
plot (x, y)
axis ([min(x) max(x) -1 1])
set (gca, 'xtick', xtick*pi, 'xticklabel', strcat (xticklabel, char
(ones (size (xtick'))*'pi')))
The problem was that you specified where the tick marks were to be
placed, but did not specify the corresponding strings.