I have a plot of distance vs. time for a large set of data. I want to draw a line, say, parallel to x-axis at a distance 2.00 (in some scale) i.e. need to add another plot of y =2. Any help might be useful;I did it by transferring the plot in another program but I want to stick in xmgrace.
Asked
Active
Viewed 8,246 times
0
-
Where is the code you currently have, and where part of this are you having trouble with? – Dec 18 '14 at 23:09
-
xmgrace file.txt ; The file consists of two column. On the plot, I want to add another plot of y =2. – Mahendra Thapa Dec 21 '14 at 20:19
1 Answers
3
You can do this easily by creating a new data set based on the equation y = 2.
From the Edit menu:
Edit > Data Sets
Now in the "Data Set Properties" window:
Edit > Create New > By Formula
Now you have to define a formula. Since you want a straight line you only need two points that correspond to the equation y = 2 and that sit at the extrema of your desired plot range. I suggest the following parameters:
"Start at" = 0
"Stop at" = <the final time of your data set>
"Length" = 2
"Set type" = "XY"
X = $t
Y = 2

feedMe
- 3,431
- 2
- 36
- 61