Friday, February 4, 2011

set ps plot


http://nstx.pppl.gov/nstx/Software/IDL/idl_intro.html#GOTCHAS

IDL> set_plot,'PS'
IDL> device, filename='your_filename.ps'
IDL> ...
IDL> ... plot some stuff ...
IDL> ...
IDL> device, /close
IDL> set_plot,'X'



Why do my graphics get erased?

window,0,retain=2,xsize=500,ysize=500


When a window gets covered, then uncovered, someone has to keep a copy of the obscured part of the image. You may or may not want to have all the images saved when they are obscured, by reasons of speed and memory.

In any case, this topic is called "backing store". It can be done by IDL, done by the windowing system, or not done. By default, the X window system does not have backing store turned on.

In IDL, there is a keyword RETAIN, for specifying which kind of backing store to use.

This may be done on a per window basis, e.g., window,0,retain=2,xsize=500,ysize=500

Backing store will now be maintained for this window by IDL

ANimation.

; File: making_waves.pro - Author: Erik Brisson
pro making_waves
a = fltarr(256,3,63)
for i=0,255 do for j=0,2 do for k=0,62 do $
a(i,j,k) = sin(float(i-k)/10.)/exp((float(i)/200.))
frames=bytarr(400,300,63)
window,retain=2,/free,title='making waves',xsize=400,ysize=300
for k=0,62 do begin $
shade_surf, a(*,*,k) & $
frames(0,0,k) = tvrd() & $
end
movie, frames, order=0
end

No comments:

Post a Comment