How to rotate a figure in PLOT? [message #48565] |
Sun, 30 April 2006 19:50  |
caitouer
Messages: 21 Registered: June 2005
|
Junior Member |
|
|
Hi, all,
I still do not figure out how to solve this. Hopefully
I could get some hints here.
I set my output as 'ps'. I want to plot three plots
in one page. Here is the basic idea:
------------------------------------------------------------ --
set_plot,'ps'
device,filename=..., /landscape
;plot the first figure
plot, x1, y1, position=[0.0,0.0,0,7,0.7]
;plot the second figure: histogram of x1
plot, x1, PSYM=10, position=[0.0,0.71,0.7,1.0]
;plot the third figure: histogram of y1
;I HAVE BIG PROBLEMS HERE. I want to plot this
;by rotation of 90 degrees (similar as portrait). I tried
;to simply exchange the order of x, y paramters but
;it does not work. By the way, /orientation is not accepted
;in plot.
------------------------------------------------------------ ---------
Thanks for kindly help,
Caitouer
|
|
|
|
Re: How to rotate a figure in PLOT? [message #48676 is a reply to message #48565] |
Tue, 09 May 2006 07:33  |
caitouer
Messages: 21 Registered: June 2005
|
Junior Member |
|
|
Hi, all,
I figure out how to do this. I post it here in case
anyone need it.
;----------------------------------------------------------- -------------
;I set minimum and maximum to do histogram
;----------------------------------------------------------- -------------
mbinsize=10
hist=HISTOGRAM(Bx, binsize=mbinsize, min=0.0, max=200.0)
npts=N_ELEMENTS(hist)
bins=FINDGEN(n_elements(hist))*mbinsize+0.0
hist_x=FLTARR(2*npts+2) & hist_y=FLTARR(2*npts+2)
FOR i=0, npts-1 DO BEGIN
hist_x(i*2)=bins(i)
hist_x(i*2+1)=bins(i)
hist_y(i*2+1)=hist(i)
hist_y(i*2+2)=hist(i)
ENDFOR
hist_x(2*npts)=bins(npts-1) & hist_x(2*npts+1)=bins(npts-1)
hist_y(2*npts+1)=0 & hist_y(0)=0
hist_x=REVERSE(hist_x, /overwrite)
hist_y=REVERSE(hist_y, /overwrite)
PLOT, hist_y, hist_x, pos=[0.76,0.0,1.0,0.74]
;----------------------------------------------------------- --------------------
|
|
|