One of the most frequently used plotting functions in S is the plot() function. This is a generic function: the type of plot produced is dependent on the type or class of the first argument.
If x and y are vectors, plot(x,y) produces a scatterplot of x against y. The same effect can be produced by supplying one argument (second form) as either a list containing two elements x and y or a two-column matrix.
Produces a time series plot if x is a numeric vector or time series object, or an Argand diagram if x is a complex vector.
f is a factor object, y is a numeric vector. The first form generates a bar plot of f; the second form produces boxplots of y for each level of f.
df is a data frame, y is any object, expr is a list of object names separated by `+' (e.g. a + b + c). The first two forms produce distributional plots of the variables in a data frame (first form) or of a number of named objects (second form). The third form plots y against every object named in expr.