Re: plot: Messed-up coordinates when switching devices [message #50270] |
Wed, 20 September 2006 08:08  |
Paolo Grigis
Messages: 171 Registered: December 2003
|
Senior Member |
|
|
It seems that set_plot,'PS' generates a new blank file, so even
if you give the oplot command with the right positional keyword,
the original plot is still going do disappear. I guess that
if you are going to overplot anything in a PS file, you should
not use device,/close before.
Ciao,
Paolo
Ingo von Borstel wrote:
> Hi there,
>
> I have a few plotting routines that shall allow plotting to the screen
> and, if a filename is supplied, concurrently into that file.
> In order to allow the usage of oplot I just switched devices as follows:
>
> PRO plotit, x,y, filename=filename, continueplot=continueplot
>
> IF NOT KEYWORD_SET(continueplot) THEN BEGIN
> PLOT, x,y
> IF KEYWORD_SET(filename) THEN BEGIN
> SET_PLOT('PS')
> DEVICE, file=filename, /ENCAPSULE, COLOR=8
> PLOT, x,y, /DEVICE
> DEVICE, /CLOSE
> SET_PLOT('X')
> ENDIF
> ENDIF ELSE BEGIN
> OPLOT, x,y
> IF KEYWORD_SET(filename) THEN BEGIN
> SET_PLOT('PS')
> DEVICE, file=filename, /ENCAPSULE, COLOR=8
> OLOT, x,y, /DEVICE
> DEVICE, /CLOSE
> SET_PLOT('X')
> ENDIF
> ENDELSE
>
> END
>
> Now, calling first w/o continueplot and subsequently the routine with
> continueplot, the plots are not aligne anymore wrt to x-axis, the whole
> dataset is shifted and streched.
>
> I assume it has to do with the coordinate systems of the screen and the
> file that get mixed up. But I didn't find a solution to fix it. :( Any
> suggestions how to make this work or circumvent it are welcome.
>
> Best regards,
> Ingo
>
|
|
|