I have a data set which I am trying to plot with the latest CVS
version of GNUplot that will not plot with log scaling. The error
message I get with autoscaling is ""/tmp/data.gnu", line 49174: y
range must be greater than 0 for log scale" and it is! If I hard code
the range to something like : set yrange [10:200], I don't get the
error message, but I don't get a plot either.
I am using a very simple plot line: plot "-" using 1:3:5 axes x1y1
with image and the data follows it. If I go to linear scale, I get my
plot as well.
Is this a bug? I'm happy to send a data file if it would help, but it
is too large to post.
Thanks,
Joey
> Hello!
>
> I have a data set which I am trying to plot with the latest CVS
> version of GNUplot that will not plot with log scaling. The error
> message I get with autoscaling is ""/tmp/data.gnu", line 49174: y
> range must be greater than 0 for log scale" and it is! If I hard code
> the range to something like : set yrange [10:200], I don't get the
> error message, but I don't get a plot either.
>
> I am using a very simple plot line: plot "-" using 1:3:5 axes x1y1
> with image and the data follows it. If I go to linear scale, I get my
> plot as well.
But does the y range indeed include zero?
If so, the error message is simply stating the mathematical truth
that a log-scale range cannot span zero.
> Is this a bug? I'm happy to send a data file if it would help, but it
> is too large to post.
That is not necessary.
Make your linear plot and then type
show yrange
> > I have a data set which I am trying to plot with the latest CVS
> > version of GNUplot that will not plot with log scaling. The error
> > message I get with autoscaling is ""/tmp/data.gnu", line 49174: y
> > range must be greater than 0 for log scale" and it is! If I hard code
> > the range to something like : set yrange [10:200], I don't get the
> > error message, but I don't get a plot either.
>
> > I am using a very simple plot line: plot "-" using 1:3:5 axes x1y1
> > with image and the data follows it. If I go to linear scale, I get my
> > plot as well.
>
> But does the y range indeed include zero?
> If so, the error message is simply stating the mathematical truth
> that a log-scale range cannot span zero.
No, the y-data does not contain zero or negative numbers.
>
> > Is this a bug? I'm happy to send a data file if it would help, but it
> > is too large to post.
>
> That is not necessary.
> Make your linear plot and then type
> show yrange
gnuplot> show yrange
set yrange [ * : * ] noreverse nowriteback # (currently
[9.34098:9.87254] )
is what I get, but those number are very strange. My plot goes from 0
to 250 on the y axis? Where do these numbers come from?
Joey
> On Mar 16, 11:37 am, sfeam <sf...@users.sourceforge.net> wrote:
>> Joey Mukherjee wrote:
>
>> > I have a data set which I am trying to plot with the latest CVS
>> > version of GNUplot that will not plot with log scaling. The error
>> > message I get with autoscaling is ""/tmp/data.gnu", line 49174: y
>> > range must be greater than 0 for log scale" and it is! If I hard code
>> > the range to something like : set yrange [10:200], I don't get the
>> > error message, but I don't get a plot either.
>>
>> > I am using a very simple plot line: plot "-" using 1:3:5 axes x1y1
>> > with image and the data follows it. If I go to linear scale, I get my
>> > plot as well.
>>
>> But does the y range indeed include zero?
>> If so, the error message is simply stating the mathematical truth
>> that a log-scale range cannot span zero.
>
> No, the y-data does not contain zero or negative numbers.
You say that, but...
>[snip]
> My plot goes from 0
> to 250 on the y axis? Where do these numbers come from?
Here you say it goes from 0, which means you cannot use a log scale.
Try setting:
set yrange [0.1:*]
> No, the y-data does not contain zero or negative numbers.
[...]
> My plot goes from 0 to 250 on the y axis?
Hmm... haven't you just contradicted yourself?
The axis goes from 0 to 250, but my lowest value in my data is
0.0782884, not zero.
If I do a "set yrange [0.1:*]", I do see my plot, but the there is a
huge blank space between 0.1 and 10, and the rest of the data from 10
to 200 or so and then more blank space from 250 to 1000. If I set the
lower value to 10 in the set yrange command, I see no plot at all! I
just want to see the data from 10 to 200 along a logarithmic Y scale.
I'm happy to email a script to someone if it would help!
Joey
> I just want to see the data from 10 to 200 along a logarithmic Y scale.
So did you try
set yrange [10:200]
?
Yes, and that is when I do not see a plot. That's the bug! I don't
think the y-range is working correctly on a log scale with an image.
Joey
OK. I can reproduce this.
Yes, it's a bug.
I don't know of a work-around.
> OK. I can reproduce this.
> Yes, it's a bug.
> I don't know of a work-around.
After reading this thread, I have made a similar test. I have image data
from about 0:6 in x and 0:25 in y. Setting xrange to 0.1:10 and logscale
x my plot dissappears as well, and I am getting the warning "Image grid
must be at least 2 x 2." (using a recent CVS version).
Another effect that may be related to this problem: Try setting the
xrange to the same value as in the logscale plot, but instead of using
the logscale just replace 1:... by (log10($1)):... in the "using"
statement. Instead of rescaling the abscissae to the log values the plot
gets completely distorted in *both* axes. This, however, was not
reproducable: In subsequent tests there was no plot at all but the
message "Number of pixels cannot be factored into integers matching
grid. N = 180901 K = 101". Other nonlinear modifiers like sqrt(x), x**2
seem to work normally.
Maybe these infos could help to solve the problem.
Ingo