Hello!
I met a problem when image an 2d histogram. Here is part of the codes:
-----------------------------------
w0 = window(dimensions=[800,600])
x = raw.v-raw.i
y = raw.v
upperpart = [0.1,0.1,0.9,0.9]
ngrids = 500
bin1 = (max(x)-min(x))/ngrids
bin2 = (max(y)-min(y))/ngrids
max1 = max(x)
min1 = min(x)
max2 = max(y)
min2 = min(y)
h2d = hist_2d(x,y,bin1=bin1,bin2=bin2,max1=max1,min1=min1,max2=max2,min2=min2)
h2d = bytscl(alog10(h2d>1))*0.8
ct = colortable(0,/reverse)
g0 = image(h2d,rgb_table=ct,axis_style=0,margin=0.1,/current,xrange=[0,ngrids-1],yrange=[ngrids-1,0])
g0.position=upperpart
xfoo = findgen(3)
yfoo = findgen(3)
p2 = plot(xfoo,yfoo,'o',xrange=[min1,max1],yrange=[max2,min2],sym_color='red',nodata=0,/current)
p2.position=upperpart
----------------------------------------------
The plot shows properly in the graphic interface and can be saved with .png extension. But when try to save to a .eps or .ps format, the yrange did not work properly, and the image reversed in the up and down direction. It is a little weird.
Thank you for look at this post.
|