[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Zooming in Object Graphics

Ben Tupper (btupper@bigelow.org) writes:

> I don't want to open a can of worms, but...
> This topic always reminds me of Randall Frank's recommendation to use
> natural data coordinates rather than normalized data coordinates. I have
> only done the graphics in natural coordinates a couple of times, so I'm
> skating on thin ice with wobbly ankles. Zooming seems like a place where
> it might be especially useful; of course, it's just a hunch and I've yet
> to try it.  
> The ViewPlane_Rect would have to change as well as the location of the
> axes/annotations (unless you didn't care to see them when zooming, kind
> of like zooming on a bitmap.)  The data ranges can be controlled by the
> [XYZ]RANGE keywords.  The tricky part is setting up the ViewPlane_Rect
> so there will be enough room for the axes, etc.  I know I build in the
> border when making object graphics in normalized coordinates
> (ViewPlane_Rect = [-.2,-.2, 1.4,1.4] or some such thing.)  In natural
> coordinates maybe the following could be done:
> xMin = Min(ZoomedDataX, Max = xMax)
> yMin = Min(ZoomedDataY, Max = yMax)
> xSpan = xMax-xMin
> ySpan = yMax-yMin
> oView->SetProperty, ViewPlane_Rect = [xMin-0.2*xSpan, yMin-0.2*ySpan,
> xSpan*1.4, ySpan*1.4]
> oGrAtom->SetProperty, xRange = [xMin,yMin], yRange = [yMin,yMax]
> oXaxis->Location = [xMin,yMin,0], Range = [xMin,xMax]
> oYaxis->Location = [xMin,yMin,0], Range = [yMin,yMax]
> Well, it's the holiday season, perhaps I'm having visions of sugared plums...

I don't know. Maybe with a couple more egg-nogs I could
see it, but I don't understand how this will *zoom* anything.
If you change *both* the viewport rectangle *and* the axes
endpoints, aren't you just back to where you started!?



David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155