The default axis-drawing behavior of IDL Direct Graphics is to choose a start and end-point for the axis display that promotes nice round numbers for a set of evenly-spaced tick marks. To override this default behavior and get the axes to draw according to a programmer's exact specifications IDL Direct Graphics has the keywords X|Y|ZSTYLE, which, when set to the value 1, will put the end-points of an axis at either the end values specified by the X|Y|ZRANGE keywords or, if those are not present, at the MIN( ) and MAX( ) values of the data argument(s). Thus:
plot, year, period, XRANGE=[2008, 30000], YRANGE=[0.99, 1.01], PSYM=3, XSTYLE=1
will whip your X axis into shape (but still let IDL decide on the "prettiest" Y axis limits). You might prefer to call this with a slightly rounder X axis limit, like:
plot, year, period, XRANGE=[2000, 30000], YRANGE=[0.99, 1.01], PSYM=3, XSTYLE=1
James Jones
|