Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Re: question about plot contours over a color figure
yinghui writes: > I am wondering what is wrong here, why I need two contour lines > commands to get the contoure lines come up? You can't both establish the contour data space AND overplot the contour lines (OVERPLOT keyword) on the same command. OVERPLOT assumes a data space is already established. (It is similar to PLOTS in this regard.) I would use a CONTOUR with NODATA and [XY]STYLE=5 keywords to establish the data coordinate space. Then use the CONTOUR command with OVERPLOT to draw the contour lines, if that is what you want to do. IMGDISP or TVIMAGE will make this a WHOLE lot easier for you! :-) Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.dfanning.com/
yinghui wrote: > Hi: > > I want to plot the confidence level contours over a color figures in a > PS file. > > I have no problem to plot the color figures in the PS file, using > tv,sdata,x0,y0,xsize=xsize,ysize=ysize,/normal ;;sdata is the data I > used to plot the figure plot. > here x0=y0=0.1, xsize=ysize=0.7 > > But when I want to add the contours on the same plot, I add one line > after the TV command, as > contour,tempc,x,y,max_value=100.,min_value=0.,levels=[80.,90 .,95.], > $ > c_labels=[1,1,1],c_colors=[1,0,1],position=[0.1,0.1,0.8,0.8] , > $ > c_charsize=1.,c_charthick=1.5,c_thick=1.5,xstyle=5,ystyle=5, > $ > /overplot ;tempc is the confidence level data > No contours come up, or sometimes in a small area at the corner of the > window. > I put this line before TV, the contures do not come up for the color > fiugre covers the contoure lines. > > But if I keep the contour command after the TV command, and add almost > the same contour line before the TV line, as > > contour,tempc,x,y,max_value=100.,min_value=0.,levels=[80.,90 .,95.], $ > > c_labels=[1,1,1],c_colors=[1,0,1],position=[0.1,0.1,0.8,0.8] , > $ > c_charsize=1.,c_charthick=1.5,c_thick=1.5,xstyle=5,ystyle=5, > $ > /noerase > > The contours come up as I wanted. > > I am wondering what is wrong here, why I need two contour lines > commands to get the contoure lines come up? > > Thanks > > yinghui Take a look at the RSI supplied image_cont.pro -- it plots the data and overplots it with contour lines. It would be trivial to modify to display one set of data and overplot another set as contours. Cheers, Manodeep