axis                  package:base                  R Documentation

_A_d_d _a_n _A_x_i_s _t_o _a _P_l_o_t

_D_e_s_c_r_i_p_t_i_o_n:

     Adds an axis to the current plot, allowing the specification of
     the side, position, labels, and other options.

_U_s_a_g_e:

     axis(side, at, labels = TRUE, tick = TRUE, line = 0,
          pos = NA, outer = FALSE, ...)

_A_r_g_u_m_e_n_t_s:

    side: an integer specifying which side of the plot the axis is to
          be drawn on.

      at: the points at which tick-marks are to be drawn. Non-finite
          (infinite, `NaN' or `NA') values are omitted.

  labels: this can either be a logical value specifying whether
          (numerical) annotations are to be made at the tickmarks, or a
          vector of character strings to be placed at the tickpoints.

    tick: a logical value specifying whether tickmarks should be drawn

    line: the number of lines into the margin which the axis will be
          drawn.  This overrides the value of the graphical parameter
          `mgp[3]'.  The relative placing of tickmarks and tick labels
          is unchanged.

     pos: the coordinate at which the axis line is to be drawn. this
          overrides the value of both `line' and `mgp[3]'.

   outer: a logical value indicating whether the axis should be drawn
          in the outer plot margin, rather than the standard plot
          margin.

     ...: graphical parameters may also be passed as arguments to this
          function.

_D_e_t_a_i_l_s:

     The axis line is drawn from the lowest to the highest value of
     `at', but will be clipped at the plot region. Only ticks which are
     drawn from points within the plot region (up to a tolerance for
     rounding error) are plotted, but the ticks and their labels may
     well extend outside the plot region.

_V_a_l_u_e:

     This function is invoked for its side effect, which is to add an
     axis to an already existing plot.  The axis is placed as follows:
     1=below, 2=left, 3=above and 4=right.

_E_x_a_m_p_l_e_s:

     plot(1:4, rnorm(4), axes=FALSE)
     axis(1, 1:4, LETTERS[1:4])
     axis(2)
     box() #- to make it look "as usual"

     plot(1:7, rnorm(7), type = 's', xaxt='n', col = 'red')
     axis(1, 1:7, LETTERS[1:7], col.axis = 'blue')

