davidf@dfanning.com (David Fanning) wrote:
>
> Cathy (csaute3@alumni.umbc.edu) writes:
>
>> I would like to use !P.MULTI and TV to position images like you
>> would plots.
>
>> IDL> window, 0
>> IDL> !p.multi = [0,1,4,0,0]
>> IDL> plot, indgen(10)
>> IDL> plot, indgen(20)
>> IDL> plot, indgen(30)
>> IDL> plot, indgen(40)
>>
>> Is there something else that has this capability?
>>
>
> I can see that "IDL doesn't work like this" won't satisfy
> you. How about something like this:
>
> ************************************************************ ****
> PRO MultiImages, multi
> IF N_Params() NE 1 THEN multi = [0, 2, 2]
> imageFile = Filepath(SubDir=['examples','data'], 'worldelv.dat')
> image = BytArr(360, 360)
> OpenR, lun, imageFile, /Get_LUN
> ReadU, lun, image
> Free_Lun, lun
> Window, XSize=500, YSize=400
> !P.Multi = multi
> FOR j=0, multi[1]*multi[2]-1 DO BEGIN
> Plot, Findgen(11), Color=!P.Background ; A hack, unfortunately. :-(
> x1 = !X.Region[0] + 0.05
> x2 = !X.Region[1] - 0.05
> y1 = !Y.Region[0] + 0.05
> y2 = !Y.Region[1] - 0.05
> TVImage, image, Position=[x1, y1, x2, y2]
> ENDFOR
> END
> ************************************************************ ******
>
> If you want the images in, for example, a 3-by-2 arrangement,
> you can type this:
>
> !P.Multi = [0, 3, 2]
> IDL> MultiImages, !P.Multi
This works well. In addition to the image, I would like to add axes, etc.
so I did this loop:
FOR j=0, multi[1]*multi[2]-1 DO BEGIN
; establish the size of the plot window
Plot, Findgen(11), Color=!P.Background
x1 = !X.Region[0] + 0.05
x2 = !X.Region[1] - 0.05
y1 = !Y.Region[0] + 0.05
y2 = !Y.Region[1] - 0.05
TVImage, image, Position=[x1, y1, x2, y2]
Plot, Findgen(11), position=[x1, y1, x2, y2], xticklen=-0.02, $
yticklen=-0.02, xtitle='latitude', ytitle='longitude', /nodata, $
/noerase
ENDFOR
However the xtitle is "cut off" for image(s) along the bottom of the window,
and ytitle is "cut off" for image(s) along the left of the window.
Is there a way to "make them visible"?
Also, if I left the position keyword out of the second plot command,
the plot appeared in the quadrant next to the tvimage (not overlay).
Why?
Thanks for your help,
Cathy
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
|