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

Re: plot range in Object Graphics



> Uh, well, I get identical results in my object graphics
> XPLOT program (download the latest, there have been some
> changes in most of these object program examples in the
> past week or so) as I do in the direct graphics case.
> Perhaps you are scaling the axes incorrectly. That is
> *easy* to do in object graphics.

OK, I've found the problem.  I was testing this in version 5.0, and that seems
to be the problem. The plot draws properly in version 5.3, but not in 5.0.
Water under the bridge, I guess.
(I don't know if XPlot would also have this problem, since it requires 5.3)

Anyhow, I'd like to be clear on this (since I'm only writing this object as an
excersize to figure out how to do it!)  I've looked through XPlot, and I
think, to paraphrase, the proper steps are:

-create an IDLgrPlot with the range parameters
-retrieve the range properties from the IDLgrPlot
-create IDLgrAxis with the retrieved range
-retrieve the CRange property from the axis
-normalize the CRange to get the scaling factors
-set the coordinate conversion factors in the plot and axes

Now I want to go one further. In my object I want to add and remove plot lines
to the model without creating new axes. When initializing my object, I go
through the steps above. So here's my question:
Suppose I've set up some axes and a IDLgrPlot that have xranges of [0,8.5]. If
I want to add a second IDLgrPlot with x data values that go from -1 to 10, and
have the plot lines end exactly at the axes at x=0 and x=8.5, all I have to do
is get the cxrange and cyrange from the existing axis, and use this for the
xrange and yrange of the new IDLgrPlot.

Is this correct?


Thanks again,


Brad



P.S. the code I attached in the previous post references another bit of code
so it won't compile for you.. If anyone wants to see the problem I'm talking
about in version 5.0, try the simpler code I've attached here.

test.pro