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

coordinate conversion factor woes in object graphics



I'm having a little trouble with my axes in object graphics. Following
David Fanning's canonical method for producing x-y plots in object
graphics, I use the xcoord_conv and ycoord_conv keywords to the
IDLgrAxis and IDLgrPlot objects to scale the plot properly in the
window.  My problem is that when the range of the axes is small compared
to the value of the axis origin (ie.  (xrange[1]-xrange[0])/xrange[1] <~
1e-6) , the axis don't get positioned properly in the window.

For example, say I want to plot something as a function of julian date,
over a range of a few days. The xrange is small, whereas the julian day
numbers are huge. In direct graphics, the axes look fine, but not in
object graphics. The following code shows the problem, using David's
XPlot routine that can be found on his webpage.

pro test
    x=dindgen(100)/100+2451598        ;a span of one julian day.
    y=sin(x)
    xplot, x, y            ;note that the axes don't align properly.
    window, 0
    plot, x, y                ;the rounding error in the data is
visible, but the axes look right.
end


How can I get around this?  Is there another (better) approach to
scaling plots into a window?

Thanks

Brad