Thursday, August 12, 2010

Contour Plots

Nic wants me to put some contour plots in my likelihood paper. Here is some playing to make the plots....

From this tutorial: http://xweb.geos.ed.ac.uk/~hcp/notes/node4.html

I'm using the "everything else" catalog as my data to plot.

Color-Color Scatter Plot

The code:

!P.FONT = 1
!P.THICK = 2
DEVICE, SET_FONT ='Times',/TT_FONT

xtitle = 'u-g magnitude'
ytitle = 'g-r magnitude'
mtitle = 'Color-Color Diagram All Input QSOs'

window,xsize=700,ysize=600
plot, ugscolor[0:2], grscolor[0:2], ps=3, xr=[-0.5,4],yr=[-0.5,2],XTITLE = xtitle, YTITLE = ytitle, TITLE = mtitle, charsize = 2, charthick = 1
;Stars
oplot, ugscolor[ii], grscolor[ii], ps=3, color=fsc_color('red')

Mesh Surface Plot

The Code:

bin_width = 0.05
minx=-0.5
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]))
x_cont = (x_cont*bin_width) + minx

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



;Mesh surface
xtitle = 'u-g magnitude'
ytitle = 'g-r magnitude'
ztitle = 'density'
mtitle = 'Color-Color Density Plot'

window,xsize=700,ysize=600
!P.THICK = 1

surface,star_contours,x_cont,y_cont,XTITLE = xtitle, YTITLE = ytitle, ZTITLE=ztitle, TITLE = mtitle, charsize = 4, charthick = 1, ax = 45, az = 10

B&W Shaded Surface
The code:
shade_surf,star_contours,x_cont,y_cont,XTITLE = xtitle, YTITLE = ytitle, ZTITLE=ztitle, TITLE = mtitle, charsize = 4, charthick = 1, ax = 45, az = 10

B&W Contour Plot

The Code:
mtitle = 'Color-Color Contour Plot'
contour,star_contours,x_cont,y_cont,levels=findgen(75)*100,XTITLE = xtitle, YTITLE = ytitle, TITLE = mtitle, charsize = 2, charthick = 1,/follow

logfile: ../logs/100812log.pro

No comments:

Post a Comment