plot                package:graphics                R Documentation

_G_e_n_e_r_i_c _X-_Y _P_l_o_t_t_i_n_g

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

     Generic function for plotting of R objects.  For more details
     about the graphical parameter arguments, see 'par'.

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

     plot(x, y, ...)

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

       x: the coordinates of points in the plot. Alternatively, a
          single plotting structure, function or _any R object with a
          'plot' method_ can be provided.

       y: the y coordinates of points in the plot, _optional_ if 'x' is
          an appropriate structure.

     ...: graphical parameters can be given as arguments to 'plot'. 
          Many methods will also accept the following arguments:

     _t_y_p_e what type of plot should be drawn.  Possible types are

             *  '"p"' for *p*oints,

             *  '"l"' for *l*ines,

             *  '"b"' for *b*oth,

             *  '"c"' for the lines part alone of '"b"',

             *  '"o"' for both "*o*verplotted",

             *  '"h"' for "*h*istogram" like (or "high-density")
                vertical lines,

             *  '"s"' for stair *s*teps,

             *  '"S"' for other *s*teps, see _Details_ below,

             *  '"n"' for no plotting.

          All other 'type's give a warning or an error; using, e.g.,
          'type = "punkte"' being equivalent to 'type = "p"' for S
          compatibility.

     _m_a_i_n an overall title for the plot: see 'title'.

     _s_u_b a sub title for the plot: see 'title'.

     _x_l_a_b a title for the x axis: see 'title'.

     _y_l_a_b a title for the y axis: see 'title'. 

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

     For simple scatter plots, 'plot.default' will be used. However,
     there are 'plot' methods for many R objects, including
     'function's, 'data.frame's, 'density' objects, etc.  Use
     'methods(plot)' and the documentation for these.

     The two step types differ in their x-y preference: Going from
     (x1,y1) to (x2,y2) with x1 < x2, 'type = "s"' moves first
     horizontal, then vertical, whereas 'type = "S"' moves the other
     way around.

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

     'plot.default', 'plot.formula' and other methods; 'points',
     'lines', 'par'.

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

     data(cars)
     plot(cars)
     lines(lowess(cars))

     plot(sin, -pi, 2*pi)

     ## Discrete Distribution Plot:
     plot(table(rpois(100,5)), type = "h", col = "red", lwd=10,
          main="rpois(100,lambda=5)")

     ## Simple quantiles/ECDF, see ecdf() {library(stats)} for a better one:
     plot(x <- sort(rnorm(47)), type = "s", main = "plot(x, type = \"s\")")
     points(x, cex = .5, col = "dark red")

