comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Altered device coordinates after first call
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Altered device coordinates after first call [message #50840] Mon, 16 October 2006 08:59
Juan Arrieta is currently offline  Juan Arrieta
Messages: 6
Registered: February 2006
Junior Member
Dear IDL experts,

After some data processing, I need to display my results in a "nicely
formatted" page. Specifically, my page is landscape letter paper, with
a header and a footer, both 5% off the corresponding margins. I know
how to create this "margins" and this "header and footer zones".
Now, I can add the plots of my data by using the position keyword.
Everything is nice and easy, but the problem is the following:
I run the script ONCE and everything behaves as expected. The SECOND
and subsequent calls render the PLOTS correctly, but completely ruin
the "margings, header, and footer". It appears like if the device
coordinates used to create the plots were overriding the "hard-coded"
geometry I provided. Also, I notice that after I call one time the
script, all the direct graphics plot appear in yellow, though I have
not even used color here. It seems that some environment variables (or
global variables, you know, the ones that begin with exclamation mark)
are being set after I call the subroutine.

Please have a look at my code, the data is of course fictitious, but
the general idea is to produce a nice looking letter-size output. If
you want to see the PS, uncomment the corresponding lines. The code as
it is will produce a direct graphics plot.

I am using IDL 6.2 (Linux x86_64 m64) in a linux workstation (red hat
enterprise 4.0) (opteron processors)

Thanks a lot. I appreciate any help.

/ Juan Arrieta

PRO TSTDIAGRAM
; EXAMPLE FOR TESTING THE OUTPUT IN A LETTER-SIZE DEVICE (8.5X11)

; SET THE DEVICE (8.5X11IN PAPER (LANDSCAPE), WITH ONE INCH MARGINS)
;SET_PLOT,'PS'
;DEVICE,/INCHES,FILENAME='TST.ps',XSIZE=9.0,YSIZE=6.5,/LANDS CAPE,XOFFSET=1.0,YOFFSET=10.0

; EDGE COORDINATES
X0 = 0.0
X1 = 1.0
Y0 = 0.0
Y1 = 1.0

; BOX
PLOTS,[0,0],[0,1]
PLOTS,[0,1],[1,1]
PLOTS,[1,1],[1,0]
PLOTS,[1,0],[0,0]
; HEADER AND FOOTER
PLOTS,[0,1],[0.95,0.95]
PLOTS,[0,1],[0.05,0.05]
; HEADER AND FOOTER BINS
PLOTS,[0.25,0.25],[1.0,0.95] ; SECOND HEADER BIN
PLOTS,[0.50,0.50],[1.0,0.95] ; THIRD HEADER BIN
PLOTS,[0.75,0.75],[1.0,0.95] ; FOURTH HEADER BIN
PLOTS,[0.25,0.25],[0.0,0.05] ; SECOND FOOTER BIN
PLOTS,[0.50,0.50],[0.0,0.05] ; THIRD FOOTER BIN
PLOTS,[0.75,0.75],[0.0,0.05] ; FOURTH FOOTER BIN


; NASA LOGO AND "PREPARED BY" STRING
NASA = '!10nasa!N!X'
XYOUTS,0,-0.05,NASA,SIZE=2
XYOUTS,1,-0.05,'Prepared by J. J. Arrieta-Camacho',ALIGN=1.0

; TITLE
XYOUTS,0.5,1.025,'December 18, 2018',ALIGN=0.5,SIZE=2.5

; EARTH, MOON, AND OTHER SYMBOLS
EARTH = '!20S!N!X'
MOON = '!20V!N!X'
EQUINOX = '!20x!N!X'
DELTA = '!4D!N!X'
RAAN = '!4X!N!X'
TRAN = '!4x!N!X'

; DIRECTION OF MANEUVER (EARTH-MOON OR MOON-EARTH) PLACED IN THE FIRST
; HEADER BIN
STR = 'Maneuver: '+EARTH+' - '+MOON
XYOUTS,(0.25-0.0)/2.0,0.965,STR,ALIGN=0.5,CHARSIZE=1.5

; TYPE OF MANEUVER
STR = 'Ballistic (TLI)'
XYOUTS,0.25+(0.5-0.25)/2.0,0.965,STR,ALIGN=0.5,CHARSIZE=1.5

; RADIUS OF EARTH PARKING ORBIT
STR = '!SH!D'+EARTH+'!N'+'='+'200 km'
XYOUTS,0.50+(0.75-0.50)/2.0,0.965,STR,ALIGN=0.5,CHARSIZE=1.5

; RADIUS OF MOON TARGET ORBIT (PERIAPSIS)
STR = '!SH!D'+MOON+'!N'+'='+'200 km'
XYOUTS,0.75+(1.05-0.75)/2.0,0.965,STR,ALIGN=0.5,CHARSIZE=1.5



; COORDINATE SYSTEM
STR = 'TEME J2000'
XYOUTS,0.0+(0.25-0.00)/2.0,0.015,STR,ALIGN=0.5,CHARSIZE=1.5

; RIGHT ASCENSION OF THE ASCENDING NODE (TRANSFER ORBIT)
STR = RAAN + '=' + '237.45 deg'
XYOUTS,0.25+(0.50-0.25)/2.0,0.015,STR,ALIGN=0.5,CHARSIZE=1.5

; TRANSFER TIME
STR = 'TLC '+'='+'72.012 h'
XYOUTS,0.50+(0.75-0.50)/2.0,0.015,STR,ALIGN=0.5,CHARSIZE=1.5

; DELTA-V
STR = DELTA+'V'+'='+'3.4526 km/s'
XYOUTS,0.75+(1.00-0.75)/2.0,0.015,STR,ALIGN=0.5,CHARSIZE=1.5

;;; THE REST OF THE CODE IS WHERE I WOULD BE ADDING MY PLOTS

!Y.OMARGIN = [3.5,3.5]
!P.MULTI=[0,3,2]
FOR J = 0,5 DO PLOT, FINDGEN(10),/noerase

;DEVICE,/CLOSE
;SET_PLOT,'X'
END
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Basic format code question
Next Topic: IImage Command Line

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:09:04 PDT 2025

Total time taken to generate the page: 0.00586 seconds