|
From: Petr M. <mi...@ph...> - 2008-01-03 12:18:37
|
There is a difference between gnuplot 4.2.2 and cvs; 4.2.2 works OK for log cb axis, while cvs gives this error: "bug_logcb.gp", line 4: color axis has cb coord of -10; must be above 0 for log scale! What has broken in cvs? Script: plot 'matrix.dat' matrix with image set log cb replot File matrix.dat: 2 4 6 8 1 2 3 4 0 1 2 3 -2 -1 1 2 -4 -3 -2 -1 -6 -5 -4 -3 --- PM |
|
From: Ethan M. <merritt@u.washington.edu> - 2008-01-03 17:23:50
|
On Thursday 03 January 2008 04:18, Petr Mikulik wrote: > There is a difference between gnuplot 4.2.2 and cvs; 4.2.2 works OK for log > cb axis, while cvs gives this error: > > "bug_logcb.gp", line 4: color axis has cb coord of -10; must be above 0 > for log scale! > > What has broken in cvs? But the error message is correct. The cb values go negative and therefore log scale cannot work. I see that 4.2 does draw something, but I don't understand what it is drawing. I'd say that 4.2 fails to detect the error, while CVS is doing the right thing by reporting it. > > Script: > > plot 'matrix.dat' matrix with image > > set log cb > replot > > File matrix.dat: > 2 4 6 8 > 1 2 3 4 > 0 1 2 3 > -2 -1 1 2 > -4 -3 -2 -1 > -6 -5 -4 -3 > > --- > PM -- Ethan A Merritt |
|
From: Petr M. <mi...@ph...> - 2008-01-04 11:42:06
|
> > "bug_logcb.gp", line 4: color axis has cb coord of -10; must be above 0 > > for log scale! > > > > plot 'matrix.dat' matrix with image > > > > What has broken in cvs? > > But the error message is correct. > The cb values go negative and therefore log scale cannot work. > > I see that 4.2 does draw something, but I don't understand > what it is drawing. I'd say that 4.2 fails to detect the > error, while CVS is doing the right thing by reporting it. No, the error message is not correct, it should autoscale the cb-value to a lower positive value, as it does in the same case for "with image" for logged y or z axes. There must have been some change in cvs which broke this for "matrix with image". Gnuplot has been always excellent in handling negative ranges in log scales. For example, gnuplot> set xrange [-10:10]; set log y; plot 1/x --- PM |
|
From: Ethan M. <merritt@u.washington.edu> - 2008-01-04 19:47:11
|
On Friday 04 January 2008 03:42, Petr Mikulik wrote:
> > > "bug_logcb.gp", line 4: color axis has cb coord of -10; must be above 0
> > > for log scale!
> > >
> > > plot 'matrix.dat' matrix with image
> > >
> > > What has broken in cvs?
> >
> > But the error message is correct.
> > The cb values go negative and therefore log scale cannot work.
> >
> > I see that 4.2 does draw something, but I don't understand
> > what it is drawing. I'd say that 4.2 fails to detect the
> > error, while CVS is doing the right thing by reporting it.
>
> No, the error message is not correct, it should autoscale the cb-value to a
> lower positive value, as it does in the same case for "with image" for
> logged y or z axes. There must have been some change in cvs which broke this
> for "matrix with image".
>
> Gnuplot has been always excellent in handling negative ranges in log scales.
This is new to me, and does not seem to agree with the documentation:
help autoscale
When autoscaling, the axis range is automatically computed and the dependent
axis (y for a `plot` and z for `splot`) is scaled to include the range of the
function or data being plotted.
You are saying that for log scales, only the range of the data greater than
some positive value epsilon is to be scaled?
I can see how this makes sense for functions, but it strikes me as being
incorrect for actual data.
Anyhow, I don't quite understand what the equivalent result would be for
plots "with image". In the example you give below for log scale on y, only
points with f(x) > 0 are displayed on the plot. Would the equivalent for
"with image" be that individual pixels are only drawn if the value of f(x,y)
is positive? That is not what version 4.2 does.
And what would be the assignment of colors? Would you limit the colors
used in the bar to the color range corresponding to positive Z values?
That would be the logical equivalent of drawing only the positive region
on y in the example below. But that is not what 4.2 does.
> For example,
>
> gnuplot> set xrange [-10:10]; set log y; plot 1/x
Anyhow, I don't have any immediate guesses as to what changed between
4.2 and current cvs.
--
Ethan A Merritt
|
|
From: Tait <gnu...@t4...> - 2008-01-04 23:27:28
|
Petr Mikulik <mikulik_physics.muni.cz> said (on 2008/01/04): > No, the error message is not correct, it should autoscale the cb-value to a > lower positive value, as it does in the same case for "with image" for > logged y or z axes. There must have been some change in cvs which broke this > for "matrix with image". > > Gnuplot has been always excellent in handling negative ranges in log scales. > For example, > > gnuplot> set xrange [-10:10]; set log y; plot 1/x I don't understand your example. The y axis range is auto-calculated (correctly, it seems) as 0.1 to 1. There is no negative log range there, and the negative y-values associated with the x=[-10:0] range are ignored. If you try something like: gnuplot> set xrange [-10:10]; set yrange [-1:1]; set log y; plot 1/x; You will, as expected, get the error "y range must be greater than 0 for log scale." This seems to be the case in 4.2 as well. Tait |
|
From: Petr M. <mi...@ph...> - 2008-01-05 12:18:49
|
> > Gnuplot has been always excellent in handling negative ranges in log scales. > > For example, > > > > gnuplot> set xrange [-10:10]; set log y; plot 1/x > > I don't understand your example. The y axis range is auto-calculated > (correctly, it seems) as 0.1 to 1. There is no negative log range > there, and the negative y-values associated with the x=[-10:0] range > are ignored. If you try something like: > > gnuplot> set xrange [-10:10]; set yrange [-1:1]; set log y; plot 1/x; > > You will, as expected, get the error "y range must be greater than 0 for > log scale." This seems to be the case in 4.2 as well. OK, I should have written "Gnuplot has been always excellent in autoscaling log axis ranges." --- PM |
|
From: Petr M. <mi...@ph...> - 2008-01-05 13:40:27
|
> This is new to me, and does not seem to agree with the documentation: > > help autoscale > When autoscaling, the axis range is automatically computed and the dependent > axis (y for a `plot` and z for `splot`) is scaled to include the range of the > function or data being plotted. > > You are saying that for log scales, only the range of the data greater than > some positive value epsilon is to be scaled? Yes, it has always worked like that. Hitting "l" for log scale, for any plot or splot with at least few positive points, gnuplot produces a reasonable drawing. > I can see how this makes sense for functions, but it strikes me as being > incorrect for actual data. Why? Negative values are e.g. electronic noise. The user is not interested in, but want to see the image in log scale of intensities. > Anyhow, I don't quite understand what the equivalent result would be for > plots "with image". In the example you give below for log scale on y, only > points with f(x) > 0 are displayed on the plot. Would the equivalent for > "with image" be that individual pixels are only drawn if the value of f(x,y) > is positive? That is not what version 4.2 does. > > And what would be the assignment of colors? Would you limit the colors > used in the bar to the color range corresponding to positive Z values? > That would be the logical equivalent of drawing only the positive region > on y in the example below. But that is not what 4.2 does. It should work in 4.3 as 4.2 works: the cb min is 0.1 (the smallest positive data point value if "set autoscale fix"), and colors of smaller values are drawn same as those corresponding to this minimum. It works everywhere like this for the cb axis. Try for example this: splot x*x-y*y*2 with pm3d set log cb replot and the colors below the limit are black. If you want to mask out some rectangles, then you need set log z; replot Consequently, there is a bug in 4.3. Wasn't it introduced in your patch from 2007-12-18? --- PM |
|
From: Ethan M. <merritt@u.washington.edu> - 2008-01-05 21:59:45
|
On Saturday 05 January 2008, Petr Mikulik wrote:
> Consequently, there is a bug in 4.3.
> Wasn't it introduced in your patch from 2007-12-18?
I don't think it is at all related. So far as I can determine,
the difference is due to a single line change from back in Aug 2007.
The following patch would return it to 4.2 behavior.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--- gnuplot-27aug2007/src/plot2d.c 2007-08-27 12:31:57.000000000 -0800
+++ gnuplot-cvs/src/plot2d.c 2008-01-05 13:41:58.000000000 -0800
@@ -223,7 +223,7 @@
AXIS_INIT2D(SECOND_Y_AXIS, 1);
AXIS_INIT2D(T_AXIS, 0);
AXIS_INIT2D(R_AXIS, 1);
- AXIS_INIT2D(COLOR_AXIS, 0);
+ AXIS_INIT2D(COLOR_AXIS, 1);
t_axis = (parametric || polar) ? T_AXIS : FIRST_X_AXIS;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
However. I do not agree that in the case of image plots the 4.2 behavior is
correct.
The plot produced by 4.2 shows a color range in which black indicates a pixel
value, in this case log(f(x,y)), less than 0.1.
But these pixel values are not, in fact, less than 0.1. They are entirely
undefined because log(x<0) is undefined. I think that the correct behavior
would be to not draw these pixels at all. This is exactly analogous to your
previous example of autoscaling 'plot [-10:10] log(x)'. The y values
corresponding to x<0 are not shown as zero; they are not drawn at all.
I take your point that one case in which pixel values are undefined is the
case of taking the log of an experimentally measured value near 0 in the
presence of finite experimental error. But that is not the general case.
For example, the matrix data file you posted at the start of this thread
contained values evenly distributed on both sides of zero. It was not
obvious that the values were expected to be all positive.
--
Ethan Merritt
(on the road)
|