stackPlot             package:ifultools             R Documentation

_S_t_a_c_k _p_l_o_t

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

     Plots input data as a stack of plots.

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

     stackPlot(x, y = NULL, xlty = NULL, bty = "n", lty = 1, col = 1:8,
         lwd = 1, rescale = TRUE, add = FALSE, cex = 1, xaxs = ifelse1(is.R(),
            "r", "e"), xpd = TRUE, yaxis = list(add = TRUE, ndigit = 3,
            col = 1:8, lty = 1, lwd = 3, side = "left", cex = 1),
         xlab = list(text = "", cex = 1, srt = 0, col = 1), ylab = list(text = NULL,
            cex = 1, srt = 0, col = 1:8, side = "right"), main = list(text = "",
            cex = 1, srt = 0, col = 1, adj = 0.5), ylim = NULL)

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

       x: a vector of numeric values corresponding to a common abscissa
          (x-axis) for all ordinate (y-axis) values.

       y: a numeric vector, matrix, data.frame, or rectangular list
          containing the ordinate (y-axis) values.

     add: a logical value. If 'TRUE', the plot is added using the
          current 'par' layout. Otherwise a new plot is produced.
          Default: 'FALSE'.

     bty: a character string defining the box type (ala 'par''s 'bty'
          parameter) for each plot. Default: '"n"' (no boxes).

     cex: a numeric value defining the character expansion for the plot
          labels (ala 'par''s 'cex' parameter). Default: 1.

     col: an integer or vector of integers denoting the color of each
          plotted series (ala 'par''s 'col' parameter). This input can
          be a vector, one color for each series plotted. If the length
          of this vector is less than the number of series, then 'col'
          is repeated as many times as necessary. Default: '1:8'.

     lty: the line type for each plot (ala 'par''s 'lty' parameter).
          This input can be a vector, one line type for each series
          plotted. If the length of this vector is less than the number
          of series, then 'lty=1' is used for those plots where lty is
          not directly specified. Default: 1.

     lwd: an integer or vector of integers denoting the line width of
          each plotted series (ala 'par''s 'lwd' parameter). This input
          can be a vector, one line width for each series plotted. If
          the length of this vector is less than the number of series,
          then 'lwd' is repeated as many times as necessary. Default:
          1.

    main: the main label as defined by a list of the following named
          objects:

          _t_e_x_t A character string defining the label. Default: '""' (no
               label).

          _c_e_x A character expansion value used to scale the label.
               Default: 1.

          _s_r_t A numerical value specifying the rotation of the label in
               degrees. Default: 0.

          _c_o_l An integer defining the color of the label. Default: 1.

          _a_d_j A numeric value on [0,1] defining the justification of
               the label relative to the entire width of the plot
               window. The value 0, 0.5, and 1 represent left, center,
               and right text alignment, respectively. Default: 0.5.

          If a partial list of the above named objects is supplied,
          those objects are merged with the default list defined above.

 rescale: a logical value. If 'TRUE', the data in each plot is scaled
          so that visually the height of each subplot is approximately
          the same (the y-axis labels denote the unscaled/original
          values. Default: 'TRUE'.

    xaxs: a character string defining the style of the x-axis interval
          calculation (ala 'par''s 'xaxs' parameter). Default: '"e"'
          (extended axes).

    xlab: the x-axis label as defined by a list of the following named
          objects:

          _t_e_x_t A character string defining the label. Default: '""' (no
               label).

          _c_e_x A character expansion value used to scale the label.
               Default: 1.

          _s_r_t A numerical value specifying the rotation of the label in
               degrees. Default: 0.

          _c_o_l An integer defining the color of the label. Default: 1.

          If a partial list of the above named objects is supplied,
          those objects are merged with the default list defined above.

    xlty: the line type (ala 'par''s 'lty' parameter) of horizontal
          lines used to separate stacked plots. Default: 'NULL' (no
          separator lines).

     xpd: a character string defining the style of the plot clipping
          (ala 'par''s 'xpd' parameter). Default: 'TRUE'.

   yaxis: the y-axis style as defined by a list of the following named
          objects:

          _a_d_d A logical value. If 'TRUE', a y-axis is drawn for each
               plot. Default: 'TRUE'.

          _n_d_i_g_i_t An integer defining the number of digits to use in
               labeling y-axis data ranges. Default: 3.

          _l_w_d An integer defining the line width of the y-axis.
               Default: 3.

          _s_i_d_e A character string (either '"left"' or '"right"'
               denoting the side to place the y-axis. Default:
               '"left"'.

          _c_e_x A character expansion value used to scale the labels on
               the y-axis. Default: 1.

          If a partial list of the above named objects is supplied,
          those objects are merged with the default list defined above.

    ylab: the y-axis label(s) as defined by a list of the following
          named objects:

          _t_e_x_t A (vector of) character string(s) defining the label(s).
               Default: the names of the y-axis labels as labeled in
               the primary 'y' input.

          _c_e_x A character expansion value used to scale the label(s).
               Default: 1.

          _s_r_t A numerical value specifying the rotation of the label(s)
               in degrees. Default: 0.

          _c_o_l A (vector of) integer(s) defining the color of the
               label(s). Default: '1:8'.

          _s_i_d_e A character string (either '"left"' or '"right"'
               denoting the side to place the y-axis label(s). Default:
               '"right"'.

          If a partial list of the above named objects is supplied,
          those objects are merged with the default list defined above.

    ylim: a two-element numeric vector containing the y-axis range of
          each series to plot. The range of the specified 'ylim' values
          must span that of all the series, otherwise an error is
          returned. Default: 'NULL' (y-axis limits are calculated
          automatically).

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

     no output.

_N_o_t_e:

     A stack plot is produced.

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

     'splitplot'.

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

     ## stack-plot the sunspots series and a random 
     ## walk series 
     set.seed(100)
     ix <- seq(2048)
     stackPlot(x=ix,
         y=data.frame(sunspots[ix], cumsum(rnorm(length(ix)))),
         xlty=2, ylab=list(text=c("sunspots","walk")))

