|
From: Jacques B. <jac...@on...> - 2005-01-08 13:10:25
|
When you try to plot an empty data-file with "plot", the output terminal is not updated, and you get this message: "no valid data points found in specified file". Why not. But if you try to plot 2 data-files, one empty the other not, you get the same answer, and that is not OK. There _is_ something to plot. That situation may arise if the data-files and the gnuplot script are generated automatically. So I think that in plot2d.c: int_error(c_token, "no valid data points found in specified file"); should be replaced with: int_warn(c_token, "no valid data points found in specified file"); |
|
From: Petr M. <mi...@ph...> - 2005-01-13 15:54:20
|
> But if you try to plot 2 data-files, one empty the other not, you get
> the same answer, and that is not OK. There _is_ something to plot. That
> situation may arise if the data-files and the gnuplot script are
> generated automatically.
>
> So I think that in plot2d.c:
>
> int_error(c_token, "no valid data points found in specified file");
>
> should be replaced with:
>
> int_warn(c_token, "no valid data points found in specified file");
This behviour is fine with me, just there should be an int_error("nothing to
plot") if there was only a single (empty) file to plot. Please update your
patch, add taking care of 3d plots.
What should happen here:
plot x*x, 'empty.dat'
?? Currently it reports an empty x-range.
---
PM
|
|
From: Ethan M. <merritt@u.washington.edu> - 2005-01-13 17:38:13
|
On Thursday 13 January 2005 07:53 am, Petr Mikulik wrote:
> >
> > So I think that in plot2d.c:
> >
> > int_error(c_token, "no valid data points found in specified file");
> >
> > should be replaced with:
> >
> > int_warn(c_token, "no valid data points found in specified file");
>
> This behviour is fine with me, just there should be an int_error("nothing to
> plot") if there was only a single (empty) file to plot. Please update your
> patch, add taking care of 3d plots.
It's more complicated that that. The first thing that will happen
if you just change int_error into int_warn is likely to be a
divide-by-zero error as the autoscaling fails. Beyond that, there
is the question of consistent behaviour of the plot.
For instance, "skipping" a plot should not change the color
assignments of the remaining plots.
So I think that to do this properly you'd have to mark the
plot empty (or just use the fact that npoints == 0), but carry it
along and test for this explicitly at every stage of the plotting
process. I think that would be straightforward, but it's a lot
more work than just changing one call.
--
Ethan A Merritt merritt@u.washington.edu
Biomolecular Structure Center
Mailstop 357742
University of Washington, Seattle, WA 98195
|
|
From: Jacques B. <jac...@on...> - 2005-01-14 10:11:09
|
Petr Mikulik <mikulik <at> physics.muni.cz> writes: > This behviour is fine with me, just there should be an int_error("nothing to > plot") if there was only a single (empty) file to plot. Please update your > patch, add taking care of 3d plots. In that case, you get this: warning: no valid data points found in specified file all points y value undefined! Clear enough, isn't it? > What should happen here: > plot x*x, 'empty.dat' You get this: warning: no valid data points found in specified file x range is invalid So you have to use, for example: plot [-1:1] x*x, 'empty.dat' The titles x*x and 'empty.dat' are shown, but only x*x is plotted. Not bad. ---------------------------------------------------------------------------- Ethan Merritt <merritt <at> u.washington.edu> writes: > It's more complicated that that. The first thing that will happen > if you just change int_error into int_warn is likely to be a > divide-by-zero error as the autoscaling fails. That doesn't happen. If an empy datafile is plotted alone, you get: warning: no valid data points found in specified file all points y value undefined! > Beyond that, there > is the question of consistent behaviour of the plot. > For instance, "skipping" a plot should not change the color > assignments of the remaining plots. There is no change of color. There is no "skipping" (the title of an empty plot is still there). ---------------------------------------------------------------------------- Hans-Bernhard Broeker <broeker <at> physik.rwth-aachen.de> writes: > But the plot command, as given, still is wrong. An entire dataset is > missing --- there'll consequently be all kinds of strange behaviour on the > plot, which are pretty much guaranteed to make the resulting diagram at > least hard to interpret, possibly unusable. Only the points are missing. The title of each empty dataset is still there. So the plot command is _not_ wrong. > If so, then it's a grave bug in the generator that it didn't notice it > just created a datafile without any data in it. The bug is not in the generator but in gnuplot. An empty datafile is not wrong. > That would cause a new problem: gnuplot would now try to generate a plot, > even if *none* of the files in the plot contain any data. No plot is generated in that case. You just get this message: all points y value undefined! And in fact, that behavior doesn't suit me: I would like gnuplot to generate a plot with no point in it, but with a title and labels (the x and y ranges must be set in that case of course). I use gnuplot to plot real time data, and I draw only the data of the last minutes. If in that time there is no data at all, I want to see the plot all the same (and I certainly don't want gnuplot to stop). --------------------------------------------------------------------------- SUMMARY: I can't see any drawback in my small patch. But it is no enough. It should be possible to plot an empty datafile (everything but the points). |
|
From: Hans-Bernhard B. <br...@ph...> - 2005-01-14 00:52:29
|
On Sat, 8 Jan 2005, Jacques Bouchard wrote: > But if you try to plot 2 data-files, one empty the other not, you get > the same answer, and that is not OK. There _is_ something to plot. But the plot command, as given, still is wrong. An entire dataset is missing --- there'll consequently be all kinds of strange behaviour on the plot, which are pretty much guaranteed to make the resulting diagram at least hard to interpret, possibly unusable. > That situation may arise if the data-files and the gnuplot script are > generated automatically. If so, then it's a grave bug in the generator that it didn't notice it just created a datafile without any data in it. > So I think that in plot2d.c: > > int_error(c_token, "no valid data points found in specified file"); > > should be replaced with: > > int_warn(c_token, "no valid data points found in specified file"); That would cause a new problem: gnuplot would now try to generate a plot, even if *none* of the files in the plot contain any data. -- Hans-Bernhard Broeker (br...@ph...) Even if all the snow were burnt, ashes would remain. |