plot: Messed-up coordinates when switching devices [message #50272] |
Wed, 20 September 2006 07:30 |
Ingo von Borstel
Messages: 54 Registered: September 2006
|
Member |
|
|
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
--
Ingo von Borstel <newsgroups@planetmaker.de>
Public Key: http://www.planetmaker.de/ingo.asc
If you need an urgent reply, replace newsgroups by vgap.
|
|
|