tags:

views:

152

answers:

2

I have some data that is a series of endpoints for the lines in x0, y0, x1, y1 format.

for example :

 x0    y0    x1    y1
-----------------------    
 1.0,  1.1,  2.0,  1.0

 2.0,  1.0,  2.0,  2.0

 2.0,  2.0,  1.0,  2.0

 1.0,  2.0,  1.0,  1.0

I don't need any axis data, text titles, or page numbers. I can scale the data up or down or add a fixed offset if required.

How would I convert this data to a file that can be printed on a sheet of 8.5 x 11 paper?

+1  A: 

If I understood you correctly, you want to plot a rectangle from (1,1) to (2,2), and remove all the axes etc.?

The easiest way is probably something like this:

unset xtics
unset ytics
unset border
set yrange [0:3]
set xrange [0:3]
set obj 1 rect from 1,1 to 2,2
plot NaN notitle

I am assuming that the first 1.1 is a typo. Otherwise you can plot individual lines:

unset xtics
unset ytics
unset border
set yrange [0:3]
set xrange [0:3]
set style arrow 1 nohead
set arrow from 1,1.1 to 2,1 as 1
set arrow from 2,1 to 2,2 as 1
set arrow from 2,2 to 1,2 as 1
set arrow from 1,2 to 1,1 as 1
plot NaN notitle
Alok
A: 

Assuming that the data is in a file called 'data.dat', probably the simplest way to draw the line segments indicating their direction (this may or may not be wanted, in which case there is also probably a formatting option to the with vectors plotting option although I don't know what it is off-hand) would be the following,

plot [0:3][0:3] 'data.dat' u 1:2:($3-$1):($4-$2) notitle with vectors

as Alok indicated in his post, the axes of the plot can be removed with the unset commands he used

unset xtics; unset ytics; unset border

This will generate a plot that looks like the following,

alt text

bpw1621
Thanks for your replies. Yes, the '1.1' was a typo, it should have been '1.0' The plot that I want to draw is not necessarily going to be a square or rectangle. I just chose the first values that came to mind.I'm still curious how I can generate a 'printable' file, ie in jpg or bmp format.
tames
@tames: look at `set term` - particularly `set term jpeg`, `set term post`, etc. For postscript, you can say `set term post portrait size 8.5 11` for letter paper in portrait orientation. Look at `help set term` and `help set out` for more.
Alok