;----------------------------------------------------------------- ; write_xmgr.pro ; ; written by Andreas Reigber ;------------------------------------------------------------------ ; Write array to disk in a format understandable by xmgr/grace. ; Sometimes this is more confortable for platting than the stupid ; IDL routines or using insight. ; ; Keywords: /DX, /DY specify error bars on X and Y axis. ;------------------------------------------------------------------ ; This software has been released under the terms of the GNU Public ; license. See http://www.gnu.org/copyleft/gpl.html for details. ;------------------------------------------------------------------ pro write_xmgr,filename,x,y,dx=dx,dy=dy anz = (size(x))[1] npa = n_params() if npa eq 2 then begin ; X-Achse selbst erzeugen y = x x = findgen(anz) endif if not keyword_set(dx) and not keyword_set(dy) then begin openw,ddd,filename,/get_lun for i=0,anz-1 do begin printf,ddd,x[i],y[i] endfor close,ddd endif if keyword_set(dx) and not keyword_set(dy) then begin openw,ddd,filename,/get_lun for i=0,anz-1 do begin printf,ddd,x[i],y[i],dx[i] endfor close,ddd endif if not keyword_set(dx) and keyword_set(dy) then begin openw,ddd,filename,/get_lun for i=0,anz-1 do begin printf,ddd,x[i],y[i],dy[i] endfor close,ddd endif if keyword_set(dx) and keyword_set(dy) then begin openw,ddd,filename,/get_lun for i=0,anz-1 do begin printf,ddd,x[i],y[i],dx[i],dy[i] endfor close,ddd endif end