Discussion:
Grid lines in logscale
(too old to reply)
Martijn Kuipers
2004-07-15 15:32:28 UTC
Permalink
Hi,

I am trying to set the gridlines of a plot with a logscale. If I use
semilogy(X,Y), with a range for Y between 0.01 and 1, then I only see a
horizontal gridline at 0.1. I would like to see gridlines at
0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.2, 0.3, 0.4,
0.5, 0.6, 0.7, 0.8, 0.9, 1

I have tried to play around with set grid mytics, but to no luck.

Sorry if it has been asked before, but I can't seem to get it right.

Thanks for your time,

Martijn
Mike Deskevich
2004-07-15 17:42:40 UTC
Permalink
see 'help set xtics'
something like this:

set xtics (.01, .02, .03, .... ,.8,.9,1)
Hans-Bernhard Broeker
2004-07-16 11:43:23 UTC
Permalink
Post by Martijn Kuipers
I am trying to set the gridlines of a plot with a logscale. If I use
semilogy(X,Y),
^^^^^^^^^^^^^

Context breach? There's no such command or concept in gnuplot.
Post by Martijn Kuipers
I have tried to play around with set grid mytics, but to no luck.
Hmm.... then why does

set log y
set grid ytics mytics
plot [0.01:1] x

work quite nicely, here (using gnuplot-4.0.0 on Linux), I wonder?
--
Hans-Bernhard Broeker (***@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Theo Hopman
2004-07-16 14:17:40 UTC
Permalink
Post by Martijn Kuipers
I am trying to set the gridlines of a plot with a logscale. If I use
semilogy(X,Y), with a range for Y between 0.01 and 1, then I only see a
horizontal gridline at 0.1. I would like to see gridlines at
0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.2, 0.3, 0.4,
0.5, 0.6, 0.7, 0.8, 0.9, 1
I have tried to play around with set grid mytics, but to no luck.
What part of the results of `set grid ytics mytics` is unsatisfactory?
It does exactly what you [say you] want, although you should be sure
to issue `set mytics default` beforehand. You should, of course, make
sure you're using gnuplot 4.0.

THeo
Martijn Kuipers
2004-07-19 11:09:51 UTC
Permalink
Post by Martijn Kuipers
Hi,
I am trying to set the gridlines of a plot with a logscale. If I use
semilogy(X,Y), with a range for Y between 0.01 and 1, then I only see a
horizontal gridline at 0.1. I would like to see gridlines at
0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.2, 0.3, 0.4,
0.5, 0.6, 0.7, 0.8, 0.9, 1
I have tried to play around with set grid mytics, but to no luck.
Sorry if it has been asked before, but I can't seem to get it right.
Thanks for your time,
Martijn
I gues I was trying to hard to use specify the spacing of the gridlines,
like
set grid mytics <value>.

And yes, you're right I use semilogy in octave, mix up from my side.

Now it looks so simple, that I can't tell you what I did wrong. Except maybe
misinterpreting both the help and manual. Thanks for your response.

All it needed was a:
set grid ytics mytics

or from octave
gset grid ytics mytics

/Martijn
P.S. Now I feel stupid. Oh well, better get used to that feeling. GNUplot is
awesome.

Continue reading on narkive:
Loading...