Tuesday, August 17, 2010

Overlapping Contours


;Turn on colors
device,true_color=24,decomposed=0,retain=2

;Set up fonts
!P.FONT = -1
!P.THICK = 1
DEVICE, SET_FONT ='Times Bold',/TT_FONT

white = GetColor('White', 1)
black = GetColor('Black', 2)
green = GetColor('Green', 3)
red = GetColor('Red', 4)
blue = GetColor('Blue',5)

LoadCT, 33, NColors=levels, Bottom=3


;Set up contour data
bin_width = 0.05
minx=-1.0
miny=-0.5
maxx=4
maxy=2

star_contours = HIST_2D(ugscolor, grscolor, bin1=bin_width, bin2=bin_width, max1=maxx, MAX2=maxy, MIN1=minx, MIN2=miny)

;; This sets up (max1-min1)bin1 bins in X....
x_cont = findgen(n_elements(star_contours[*,1]))
sx_cont = (x_cont*bin_width) + minx

;; And 60 bins in y
y_cont = findgen(n_elements(star_contours[1,*]))
sy_cont = (y_cont*bin_width) + miny


qso_contours = HIST_2D(ugqcolor, grqcolor, bin1=bin_width, bin2=bin_width, max1=maxx, MAX2=maxy, MIN1=minx, MIN2=miny)

;; This sets up (max1-min1)bin1 bins in X....
x_cont = findgen(n_elements(qso_contours[*,1]))
qx_cont = (x_cont*bin_width) + minx

;; And 60 bins in y
y_cont = findgen(n_elements(qso_contours[1,*]))
qy_cont = (y_cont*bin_width) + miny

levels = 10
userlevels = findgen(levels)^2.5
maxlevel = max(userlevels)
smax = max(star_contours)*1.1
slevels = userlevels*smax/maxlevel

levels = 7
userlevels = findgen(levels)^2.5
maxlevel = max(userlevels)
qmax = max(qso_contours)*1.1
qlevels = userlevels*qmax/maxlevel

mtitle = 'Color-Color Contour Plot'
xtitle = 'u-g magnitude'
ytitle = 'g-r magnitude'

Window, XSize=800, YSize=700
Contour, star_contours, sx_cont, sy_cont, C_Colors=red, Background=1, Levels=slevels, Color=black, XTITLE = xtitle, YTITLE = ytitle, TITLE = mtitle, charsize = 2, charthick = 1, thick=2, xthick=2, ythick=2
Contour, qso_contours, qx_cont, qy_cont, /Overplot, Levels=qLevels, Color=blue, thick=2


set_plot, 'ps'
!P.FONT = 0
!P.THICK = 1
aspect_ratio = (7.0/8.0)
xsz = 5.0
ysz = xsz*aspect_ratio
device, filename = 'contourqsostar.eps', /color, bits_per_pixel = 8,encapsul=0, xsize=xsz,ysize=ysz, /INCHES, /TIMES, /BOLD

Contour, star_contours, sx_cont, sy_cont, C_Colors=red, Background=1, Levels=slevels, Color=black, XTITLE = xtitle, YTITLE = ytitle, TITLE = mtitle, charsize = 1, charthick = 1, thick=2, xthick=2, ythick=2
Contour, qso_contours, qx_cont, qy_cont, /Overplot, Levels=qLevels, Color=blue, thick=2

device, /close
set_plot,'X'
!P.FONT = -1
!P.THICK = 1
DEVICE, SET_FONT ='Times Bold',/TT_FONT

log file:

../logs/100817log.pro

No comments:

Post a Comment