Axis Properties

The Style of the axis can be modified according to the table below:
 

Value
Description of Axis Property Affected
1
Force exact axis range
2
Extend axis range
4
Suppress entire axis
8
Suppress box style axis (draw only one axis)
16
Inhibit setting the Y axis starting value to 0 (Y axis only)
The default is: xvalues = [2,3,4,5,6]
yvalues = 5.5, 6,6, 7.7, 8.8, 9.9]
Plot, xvalues, yvalues

You can combine more than one setting, such as in the example below:

Plot, xyvalue, yvalues, XStyle=8+1, XRange=[0,9]
Note that because the X axis range was forced (value=1), you must supply a range for the X axis.


Logarithmic Axes

Axes are made logarithmic by simply typing the keyword XLog or YLog with the plot command:

Semi-Log:

A=[12,120,1200,12000]
B=[2,4,6,8]
C=[18,180,1800,18000]

Plot, A, B, /XLOG
 
 
 
 
 
 
 

Log-Log:

A=[12,120,1200,12000]
B=[2,4,6,8]
C=[18,180,1800,18000]

Plot, A, C, /XLOG, /YLOG

 
 
 
 
 


 Tick Marks

IDL has its own way of defaulting to a series of major and minor tick marks.  If you would like to change these, here are some examples:

xvalues = [2, 3, 4, 5, 6]
yvalues = [5.5, 6.6, 7.7, 8.8, 9.9]

Plot, xvalues, yvalues

These are the tick marks that IDL chose by default for this graph.
 
 
 
 
 
 


 

 
xvalues = [2, 3, 4, 5, 6]
yvalues = [5.5, 6.6, 7.7, 8.8, 9.9]

Plot, xvalues, yvalues, $
   XTicks=2, XMinor=2, $
   YTicks=10, YMinor=1

This is the same graph as above, but the tick marks are forced.  It's not necessarily an improvement, but there may be times when you want this kind of control.  Note that for the Y axis, there is 1 minor tick specified.  Without that, IDL defaulted to 10 minor ticks.  One is the correct number of minor ticks when you really want just major ticks.  Zero doesn't work the way you might think.  Notice that on the X axis the two major tick result in 2 large units.  Two minor ticks result in 2 units between each major unit.


 Axis Line Thickness

If the default thickness of the axis lines are not suitable, you may change them as follows:


 
 

Plot, xvalues, yvalues, $
   XThick = 5,  YThick = 1.0