Hello, can gnuplot draw a piecewise constant graph from a simple data file?
Here is an example: Let the data file be like the following:
0 0
1 1
2 2
Then I want a graph that is 0 on x \in [0,1), 1 on [1,2), and so on. Is
that possible in gnuplot without modifying the data file?
I guess it is possible to run a complicated series of command to filter
the data file as gnuplot reads it, but I'm would like to be able to do
something along the lines of:
plot "data.txt" using 1:2 blabla
where "blabla" is some setting that specifies that gnuplot should use a
piecewise constant "interpolation" between data points. In fact, one
should also be able to specify if any vertical lines should be visible
or not.
Right now I generate a modified data file to accomplish this (containing
additional data points):
0 0
0.99 0
1 1
1.99 1
2 2
Best regards
Torquil Sørensen
Norway
|