Hello,
running gnuplot 6.0pl3.
I noticed that plotting into a table does not respect the xrange given in the plot command.
Example:
Create a datafile or use this datablock:
$data << EOD
1 1
2 2
3 4
4 8
5 16
EOD
You can plot this data(block):
gnuplot
plot $data with lp lt 4
or a part of it by giving a certain x-range in brackets:
gnuplot
plot [2:4] $data with lp lt 4
However, if you print the data into a table, the xrange is ignored:
~~~gnuplot
set table $k
plot [2:4] $data with table
set table
print $k
~~~
results in this output:
1 1
2 2
3 4
4 8
5 16
I expected a different output:
2 2
3 4
4 8
consistent with the function plot above.
I consider this a bug.
What is your view on this?
Thanks.
Daniel
I filed this ticket. Obviously, one can file bug reports without being logged in. I did not know this.
From the documentation:
Hello Ethan,
Thank you for your response. I missed the point in the documentation where the limitations of the plot style
with tableare clearly described.Now if I plot into a datablock using table mode and not using
with table, all points are plotted including an additional column indicating whether they are in range or not.Example:
outputs:
Can I somehow limit the output only to data that is in the requested range or do I have to do this by means of postprocessing, e.g., using data in the third column?
Thanks.
Cheers,
Daniel
Yes. You can apply a filter operation to the data. Since filtering is done prior to plotting, any points that are filtered out will not appear in the output. See
help filter if.In your case: