Re: Object Graphics plot problem [message #42432] |
Fri, 04 February 2005 07:49 |
Michael Wallace
Messages: 409 Registered: December 2003
|
Senior Member |
|
|
> Hi,
>
> Set the DOUBLE keyword for your view and it seems to work. On a
> different note, I made the view the graphics_tree for the window - so
> when i close the window the objects are nicely cleaned up - very handy
> feature. I have pasted in the changes below.
Wow! I'm always amazed at how IDL has included what you need, but
finding it is like finding a needle in a haystack. It's a good thing
that I asked the question, because it would have been a long time before
I'd have discovered the DOUBLE keyword on the view. Thanks.
-Mike
|
|
|
Re: Object Graphics plot problem [message #42434 is a reply to message #42432] |
Fri, 04 February 2005 06:07  |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
Michael Wallace wrote:
> I have run across a strange problem when I'm working with object
> graphics and have large values on the X axis. It appears that my X axis
> is losing precision when doing the plot.
>
Hi,
Set the DOUBLE keyword for your view and it seems to work. On a different note,
I made the view the graphics_tree for the window - so when i close the window
the objects are nicely cleaned up - very handy feature. I have pasted in the
changes below.
PRO Weirdness
; Make a nice sine wave
x = dindgen(360) * !dtor
y = sin(x)
; Uncomment to see a vertical line instead of a sine wave
; Add a really big number to X
x += 123456789
; Set up the objects
view = Obj_New('IDLgrView',/double) ;<<<<<<DOUBLE
model = Obj_New('IDLgrModel')
plot = Obj_New('IDLgrPlot', x, y)
view -> add, model
model -> add, plot
; Set plot scaling factors and viewplane
plot -> getProperty, XRANGE = xrange, YRANGE = yrange
plot -> setProperty, XCOORD_CONV = norm_coord(xrange)
plot -> setProperty, YCOORD_CONV = norm_coord(yrange)
view -> setProperty, VIEWPLANE_RECT = [-0.1, -0.1, 1.2, 1.2]
; Display the plot
window = Obj_New('IDLgrWindow', graphics_tree = view) ;<<<<< TREE
window -> draw, view
END
|
|
|