Gray writes:
> Okay, still not working, but in a different way. I tried to do this
> systematically, doing a .RESET to clear everything. Here's my code
> (using random x and y values for the overplot):
>
> set_plot, 'ps'
> img = readfits('myimage.fits')
> img_sz = size(img,/dim)
> keywords = psconfig(/nogui,/encapsul,/color,/inches,xsize=6,$
> ysize=6.*img_sz[0]/img_sz[1],filename='myimage.eps')
> device, _extra=keywords
> tvimage, img, /axes, axkey={xstyle:9,ystyle:9}, $
> xra=[0,img_sz[0]-1], yra=[0,img_sz[1]-1]
> x = randomu(seed,100)*(img_sz[0]-1)
> y = randomu(seed,100)*(img_sz[1]-1)
> loadct, 13, /silent
> oplot, x, y, psym=4, color=fsc_color('green')
> oplot, x+1,y+1,psym=1, color=fsc_color('red')
> oplot, x-1,y-1,psym=6, color=fsc_color('yellow')
> device, /close
> set_plot, 'x'
>
> When I do this, I have two problems: 1) my points (if they overplot
> at all, I'm not 100% convinced) are in greyscale, even though I loaded
> a new color table, and 2) I've now realized that even passing those
> black against the border of a complicated greyscale image, but it's
> there.
OK, no grey-scale color table is loaded before
you display the image. So whatever colors happen
to be loaded, will be what the image uses.
Then, if you are going to use FSC_COLOR for the
overlay colors, there is no need to load a color
table before you draw your overlays. FSC_COLOR
will load its own color in the color table before
it does the drawing. (And it will dirty the one
and only color table, which is why you have to
refresh it BEFORE you display your image!)
If your points are overlaying (only you can tell
this for sure), I can assure you they are NOT
overlaying with gray-scale colors. FSC_COLOR has
worked for a *long* time. It is *extremely* unlikely
that it would be broken, expecially with the colors
"red", "green" and "yellow". It's more likely that
you aren't drawing in a data space you think you
are drawing into.
What happened to your plot command? I thought that
was how you were setting up the data space? TVImage
may look to you like it is "doing the right thing",
but it is actually designed to "do the same wrong
thing the TV command does". That is to say, it will
not establish a data coordinate system on its own.
It seems to me the data "space" where you are drawing
your overplots is probably in some random data space
in which you accidentally drew a plot in your IDL
session.
I'd go back to the PLOT command, put your image on it,
then try to draw into it.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
|