Re: saving plots as .eps [message #17502] |
Tue, 19 October 1999 00:00 |
James Tappin
Messages: 54 Registered: December 1995
|
Member |
|
|
Dave Avis wrote:
> I am trying to save a 2D scatter plot as a .eps file. My plot is a plot of
> two vectors, for example
>
> plot xvector,yvector
>
> I have looked at online examples and printed documentation and am still
> having problems. I do
>
> set_plot 'ps'
> device,/ENCAPSULATED ;followed by other stuff
>
> My problem comes when trying to use TV or any of its other incarnations
> (TVSCL, TVRD...). It seems to me that they want a 2D array of the pixel
> values of the plot window. I am not sure how to get this array. I may be
> misunderstanding what TV is trying to do, or I may be going about it the
> wrong way, I'm not sure. Any help is most appreciated.
Unless I'm missing something in what you are trying to do; surely the best way
to do this is just to rerun the same set of plotting commands that generated
the original plot. Reading a screen plot as an image and then making a (E)PS
file of that will give you a very poor quality output compared with what you
get from making the plot directly to the (E)PS file. (A typical IDL window is
a few hundred pixels each side, for line plots PostScript describes the line
as a vector and the print driver converts it to printer dots typically 3-800
per inch).
If you actually really want a screen dump then you need to run:
image=tvrd()
set_plot 'ps'
device,/ENCAPSULATED ;followed by other stuff
tv,image, x0, y0, xsize=xs, ysize=ys
; x0, y0 = lower left corner of image, xs, ys size of image (both in physical
; units)
|
|
|