Description Usage Details Examples
Plot x
versus y
using ggplot
.
If you don't like it, I suggest sending an email to hadley@rstudio.com.
If you do like it, might I suggest a sizeable donation on behalf of justinr@umn.edu
1 | jplotxy(x, y)
|
ggplot()
is used to construct the initial plot object,
and is almost always followed by +
to add component to the
plot. There are three common ways to invoke ggplot
:
ggplot(df, aes(x, y, <other aesthetics>))
ggplot(df)
ggplot()
The first method is recommended if all layers use the same
data and the same set of aesthetics, although this method
can also be used to add a layer using data from another
data frame. See the first example below. The second
method specifies the default data frame to use for the plot,
but no aesthetics are defined up front. This is useful when
one data frame is used predominantly as layers are added,
but the aesthetics may vary from one layer to another. The
third method initializes a skeleton ggplot
object which
is fleshed out as layers are added. This method is useful when
multiple data frames are used to produce different layers, as
is often the case in complex graphics.
1 | jplotxy( x, y )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.