Friday, August 13, 2010

More Plotting

More plotting....

Plot to a file:
;Save color-color diagram to file
set_plot, 'ps'
!P.FONT = 0
!P.THICK = 2
aspect_ratio = (6.0/7.0)
xsz = 4.0
ysz = xsz*aspect_ratio
device, filename = 'ccstars.eps', /color, bits_per_pixel = 8,encapsul=0, xsize=xsz,ysize=ysz, /INCHES, /TIMES, /BOLD
ccplot, xobject, yobject, xtitle, ytitle, mtitle
device, /close
set_plot,'X'

or (from here -- note I needed to change /encapsul command to device to encapsul=0)

to_eps, /eps, device=device
ccplot, xobject, yobject, xtitle, ytitle, mtitle
to_eps, /eps, device=device, /out

It looks pretty:
Contour plot with non-linear contour levels:
!P.FONT = -1
mtitle = 'Color-Color Contour Plot'
levels = findgen(25)^2*16
contour,star_contours,x_cont,y_cont,levels=levels,XTITLE = xtitle, YTITLE = ytitle, TITLE = mtitle, charsize = 2, charthick = 1, thick=1, xthick=1,/follow



Contour plot shaded:
levels = findgen(25)^2*16
contour,star_contours,x_cont,y_cont,levels=levels,XTITLE = xtitle, YTITLE = ytitle, TITLE = mtitle, charsize = 2, charthick = 1, thick=1, xthick=2, ythick=2,/cell_fill


To overlay levels:
window,xsize=700,ysize=600
loadct, 0
nlevels = 15
levels = findgen(nlevels)^4
maxlevel = max(levels)
thismax = max(star_contours)
levels = levels*thismax/maxlevel
contour,star_contours,x_cont,y_cont,levels=levels,XTITLE = xtitle, YTITLE = ytitle, TITLE = mtitle, charsize = 2, charthick = 1, thick=1, xthick=2, ythick=2,/cell_fill
contour,star_contours,x_cont,y_cont,levels=levels,/follow,/overplot

No comments:

Post a Comment