Tick Marks and Tick Labels

Tick marks are added to an existing axes box using the tickmarks(); command. At its simplest no parameters are required and Splot tries to select a set of reasonable tick marks for both the x and y axes. Alternatively, a list of tick positions can be provided for each axis. Tick marks are lines and so the width of a tick mark is set using set (LINEWIDTH, width);. The length of a tick mark is set using set(TICKLENGTH, length);. Grid lines may be produced by choosing the length the same as the length of the axes box. If tickmarks on the outside of the axes box are desired they may be generated by setting a negative tick length.

Tick labels are produced with the ticklabel(); command. At its simplest no parameters are required and Splot labels a subset of the existing tick marks on the bottom and left side. Alternatively, an axis may be specified along with a list of tick label positions. At its most powerful each tick position may be paired with a text string allowing any arbitrary string to appear at the desired location. In this way tick labels need not be in the same units as those used to draw the graph. Tick labels are just text and tick label appearance is affected by the text attributes discussed in [*].

#include <splot.h>
main() 
   {
   /* tick marks and tick label example */
   abox(12,12,5,6);
   ascale(XAXES,0,100);
   ascale(YAXES,0,30);

   /* default tick marks and labels */
   tickmarks(BOTTOM);
   ticklabel(BOTTOM);

   gsave();

   /* grid lines */
   set(TICKLENGTH,12);
   tickmarks(LEFT);
   ticklabel(LEFT);

   /* thick -ve ticks at specified positions  */
   set(LINEWIDTH,0.2);    
   set(TICKLENGTH,-0.3);
   tickmarks(RIGHT,0,5,10,15,20,25,30);
   set(LINEWIDTH,0.05);    
   set(TICKLMARG,0.5);
   ticklabel(RIGHT,0,30);

   grestore();

   /* ticks by spacing and custom labels */
   tickmarks(TOP,5);
   ticklabel(TOP,0,"0",50,"5x10^1^",100,"10^2^");

   }