Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

horizontal line in a data plot

2,339 views
Skip to first unread message

J.M.

unread,
Jun 20, 2007, 4:12:24 AM6/20/07
to
Can someone help me with the following problem:

I want to automatically create a large number of plots and all files will be
automatically generated. Although the situation is a bit more complicated,
I essentially have two data files, for example:

data1.dat

1.0 3.0
2.0 4.0
3.0 6.0

data2.dat

1/0 4.5

The format of the data files could be changed easily, if a different format
would be more suitable.

I want to just plot the data in data1.dat and I want to draw a single
horizontal line based on data2.dat, i.e. y = 4.5.

As the ranges for the various plots vary, I want to autoscale the x-axis
using the x-data in data1.dat and I want to autoscale the y-axis using the
the y-data in both data files.

Note that different horizontal lines need to be drawn for different plots,
so that I need to use data files and the data in both data files is
independent.

Simply using data2.dat

0.0 4.5
1000.0 4.5

does not work, because that also increases the xrange for the entire
plot....

Any ideas?

Thanks in advance.

Jan


Ethan Merritt

unread,
Jun 20, 2007, 11:00:23 AM6/20/07
to

How about drawing the horizontal line as a function, rather than as data?

y = `cat data2.dat`

plot "data1.dat",y

--
Ethan A Merritt

0 new messages