Log scale and image data

  • Follow


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.

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
0
Reply joeymu (3) 3/16/2010 3:07:55 PM

Joey Mukherjee wrote:

> 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


0
Reply sfeam 3/16/2010 4:37:34 PM


On Mar 16, 11:37=A0am, 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. =A0The 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! =A0If I hard cod=
e
> > 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. =A0If I go to linear scale, I get m=
y
> > 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? =A0I'm happy to send a data file if it would help, but i=
t
> > is too large to post.
>
> That is not necessary.
> Make your linear plot and then type
> =A0 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
0
Reply Joey 3/16/2010 5:14:31 PM

Joey Mukherjee wrote:

> 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:*]

0
Reply sfeam 3/16/2010 8:12:50 PM

Joey Mukherjee wrote:

> 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?
0
Reply ISO 3/16/2010 8:14:38 PM

On Mar 16, 3:14=A0pm, Hans-Bernhard Br=F6ker <HBBroe...@t-online.de>
wrote:
> Joey Mukherjee wrote:
> > 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
0
Reply Joey 3/16/2010 8:48:24 PM

Joey Mukherjee wrote:

> I just want to see the data from 10 to 200 along a logarithmic Y scale.

So did you try
   set yrange [10:200]
?
0
Reply sfeam 3/17/2010 5:07:18 AM

On Mar 17, 12:07=A0am, sfeam <sf...@users.sourceforge.net> wrote:
> Joey Mukherjee wrote:
> > I just want to see the data from 10 to 200 along a logarithmic Y scale.
>
> So did you try
> =A0 =A0set 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
0
Reply Joey 3/17/2010 7:51:58 PM

Joey Mukherjee wrote:

> On Mar 17, 12:07 am, sfeam <sf...@users.sourceforge.net> wrote:
>> Joey Mukherjee wrote:
>> > 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.

OK. I can reproduce this.  
Yes, it's a bug.
I don't know of a work-around.
0
Reply sfeam 3/17/2010 10:39:05 PM

Am 2010-03-17 23:39, schrieb sfeam:

> 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
0
Reply Ingo 3/18/2010 5:16:17 PM

9 Replies
751 Views

(page loaded in 0.157 seconds)

Similiar Articles:













7/22/2012 2:39:34 AM


Reply: