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

Re: Zooming in Object Graphics


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...


Ben Tupper
Bigelow Laboratory for Ocean Sciences
180 McKown Point Rd.
W. Boothbay Harbor, ME 04575