|
From: Ethan M. <merritt@u.washington.edu> - 2006-08-16 17:21:36
|
Someone on the usenet group reported a problem that boils down to
set log y
plot newhistogram "title", <foo>, <baz>, ...
The result is an error return
histogram has y coord of 0; must be above 0 for log scale!
Now in fact the histogram itself is fine. This error message
is triggered by attempting to place "title", which has an
implicit offset of (0,0) relative to whatever auto-generated
position the plot layout code settles on.
graphics.c 4891: map_position_r(&(histogram_opts.title.offset),
&xoffset_d, &yoffset_d,
"histogram");
and then in map_position_r we trip over:
switch (pos->scaley) {
case first_axes:
{
double yy = axis_log_value_checked(FIRST_Y_AXIS, pos->y, what);
^^^^^^^^^^^^^^^^^^^^^^
*y = yy * axis_array[FIRST_Y_AXIS].term_scale;
return;
}
I can fix this particular mess-up by initializing the offset
explicitly to be a character offset rather than a y1axis plot offset.
That's fine.
But the larger question is, why should the code invoke a range
check on the value of a relative position in the first place?
An increment of zero should be legal, log scale or not.
Isn't the check against axis_log_value_checked() in map_position_r()
a mistake?
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle WA
|