overplot               package:gplots               R Documentation

_P_l_o_t _m_u_l_t_i_p_l_e _v_a_r_i_a_b_l_e_s _o_n _t_h_e _s_a_m_e _r_e_g_i_o_n, _w_i_t_h _a_p_p_r_o_p_r_i_a_t_e _a_x_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     'overplot' graphs a set of variables defined on the same x-range
     but which have varying y-ranges on the same plotting area.  For
     each set of y-values it uses a different color and line-type and
     and draws a correspondingly colored and line-typed axis. 
     'panel.overplot' is used by 'overplot' to draw the individual
     graphs.

_U_s_a_g_e:

     overplot(formula, data = parent.frame(), same.scale = FALSE, xlab, ylab,
              xlim, ylim, min.y, max.y, log = "", panel = "panel.overplot",
              subset, plot = TRUE, groups, main, f = 2/3, ...)

_A_r_g_u_m_e_n_t_s:

 formula: Formula describing the x and y variables.  It should be of
          the form x ~ y|z. The conditioning variable (z) should be a
          factor.

same.scale: Logical value indicating whether the plot region should
          have the same range for all plots.  Defaults to 'FALSE'.

xlab, ylab, xlim, ylim, main: Standard plotting parameters.  See 'plot'
          for details

min.y, max.y: Scalar or vector values used to specify the y plotting
          limits for individual plots.  If a single scalar value is
          provided, it will be used for all plots. These parameters can
          be used specify one end of the individual plot ranges, while
          allowing the other end to vary with the data.  EG, to force 0
          to always be within the plot region.

     log: character string '', 'x', 'y', or 'xy', indicating which axes
          should be plotted on a log scale. Defaults to '' (neither).

   panel: a plotting function to be called to draw the individual
          plots.  Defaults to 'overplot.panel', which plots the points
          and a 'lowess' smooth. 

    plot: Logical value indicating whether to draw the plot.

  groups: (optional) character vector giving the names of levels of the
          conditioning variable to plot. Defaults to all levels of the
          conditioning variable.

       f: Smoothing parameter for 'lowess'

data, subset, ...: parameters passed to 'model.frame' to obtain the
          data to be plotted from the formula.

_D_e_t_a_i_l_s:

     This function essentially performs

     tmp <- split(data, z)

     for(i in levels(z))

     plot( x ~ y, data=tmp[[z]] )

     except that all of the plots are shown on the same plotting region
     and varying scales for each value of z are handled nicely.

_V_a_l_u_e:

     A copy of the data split by the conditioning variable.

_A_u_t_h_o_r(_s):

     Gregory R. Warnes warnes@bst.rochester.edu

_S_e_e _A_l_s_o:

     'interaction.plot', 'coplot' for alternative visualizations of
     3-way data.

_E_x_a_m_p_l_e_s:

     # Example teratogenicity rtPCR data
     data(rtPCR)

     # same scale
     overplot( RQ ~ Conc..ug.ml. | Test.Substance,
              data=rtPCR,
              subset=Detector=="ProbeType 7" & Conc..ug.ml. > 0,
              same.scale=TRUE,
              log="xy",
              f=3/4,
              main="Detector=ProbeType 7",
              xlab="Concentration (ug/ml)",
              ylab="Relative Gene Quantification"
              )

     # different scales, but force lower limit to 0.01 
     overplot( RQ ~ Conc..ug.ml. | Test.Substance,
              data=rtPCR,
              subset=Detector=="ProbeType 7" & Conc..ug.ml. > 0,
              log="xy",
              f=3/4,
              main="Detector=ProbeType 7",
              xlab="Concentration (ug/ml)",
              ylab="Relative Gene Quantification",
              min.y=0.01
              )

