On 4 Nov., 14:04, David Fanning <n...@dfanning.com> wrote:
> Yes, any time you do a Plot or Contour command,
> a data coordinate system is established and stored
> in system variables. It doesn't matter what window
> you issue the command in.
Ah ok. If it gets stored as system variable then the behavior makes
sense.
The extra pro was only mentioned by me because thats how I noticed the
"problem" (I used an existing pro and reduced its code for my purpose.
The /noerase was missing therefor. When I compared both pros the only
difference I noticed was the /noerase that was done in the original
prior to the main plot).
> When you use the NLEVELS keyword in a contour plot,
> you are only guaranteed the number of levels won't
> exceed N. How many *less* than N you get is a matter
> of which phase the moon is in and whether you have
> attended religious services in the past 10 days.
Final code (with correct nlevels as shown in your example):
levels = 15
step = (Max(ordim[sx:ex,sy+5:ey-5]) - Min(ordim[sx:ex,sy+5:ey-5])) /
levels
userLevels = IndGen(levels) * step + Min(ordim[sx:ex,sy+5:ey-5])
y = indgen((ey-5)-(sy+5)+1)+(sy+5)
window,5,xsize=1280,ysize=1000
loadct,0
contour,ordim[sx:ex,sy+5:ey-5],x,y,nlevels=15,thick=2.5,col= 2,
xstyle=5, ystyle=5, /nodata
display,ordim[sx:ex,sy+5:ey-5],x,y,/log,xtitle='Pixel',ytitl e='Pixel'
colors
contour,ordim[sx:ex,sy
+5:ey-5],x,y,xtitle='Pixel',ytitle='Pixel',levels=userLevels ,thick=2.5,col=2,/
overplot
write_jpeg,'contour.jpg',tvrd(true=1),true=1,quality=100
Thx again
|