Skip to content

Commit

Permalink
Re-roxygenize
Browse files Browse the repository at this point in the history
  • Loading branch information
wch committed Jun 27, 2012
1 parent 4f5b5f6 commit 54eeabb
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Expand Up @@ -83,6 +83,7 @@ export(ggplot)
export(ggplotGrob)
export(ggsave)
export(ggstructure)
export(ggtitle)
export(guide_colorbar)
export(guide_colourbar)
export(guide_legend)
Expand Down
2 changes: 1 addition & 1 deletion man/coord_polar.Rd
Expand Up @@ -49,7 +49,7 @@ ggplot(df, aes(x = "", y = value, fill = variable)) +
geom_bar(width = 1) +
scale_fill_manual(values = c("red", "yellow")) +
coord_polar("y", start=pi / 3) +
theme(title = "Pac man")
labs(title = "Pac man")

# Windrose + doughnut plot
movies$rrating <- cut_interval(movies$rating, length = 1)
Expand Down
7 changes: 6 additions & 1 deletion man/labs.Rd
@@ -1,4 +1,5 @@
\name{labs}
\alias{ggtitle}
\alias{labs}
\alias{xlab}
\alias{ylab}
Expand All @@ -9,6 +10,8 @@
xlab(label)

ylab(label)

ggtitle(label)
}
\arguments{
\item{...}{a list of new names in the form aesthetic =
Expand All @@ -19,9 +22,11 @@
}
\examples{
p <- qplot(mpg, wt, data = mtcars)
p + labs(title = "New plot title")
p + labs(x = "New x label")
p + xlab("New x label")
p + ylab("New y label")
p + ggtitle("New plot title")

# This should work indepdendently of other functions that modify the
# the scale names
Expand All @@ -33,6 +38,6 @@ p <- qplot(mpg, wt, data = mtcars, colour = cyl)
p + labs(colour = "Cylinders")

# Can also pass in a list, if that is more convenient
p + labs(list(x = "X", y = "Y"))
p + labs(list(title = "Title", x = "X", y = "Y"))
}

4 changes: 1 addition & 3 deletions man/theme.Rd
Expand Up @@ -76,10 +76,8 @@ p + xlab("Vehicle Weight") + ylab("Miles per Gallon")
# Or
p + labs(x = "Vehicle Weight", y = "Miles per Gallon")

# Add a title to the plot
p + theme(title = "Vehicle Weight-Gas Mileage Relationship")
# Change title appearance
p <- p + theme(title = "Vehicle Weight-Gas Mileage Relationship")
p <- p + labs(title = "Vehicle Weight-Gas Mileage Relationship")
p + theme(plot.title = element_text(size = 20))
p + theme(plot.title = element_text(size = 20, colour = "Blue"))

Expand Down
2 changes: 1 addition & 1 deletion man/translate_qplot_base.Rd
Expand Up @@ -143,7 +143,7 @@ last_plot() + scale_colour_gradientn(colours = terrain.colors(7))
# by box() can be controlled in a similar way by the panel.background and
# plot.background theme elements. Instead of using title(), the plot title is
# set with the title option. See ?theme for more theme elements.
last_plot() + theme(title = "My Plot Title")
last_plot() + labs(title = "My Plot Title")
}
}

2 changes: 1 addition & 1 deletion man/translate_qplot_ggplot.Rd
Expand Up @@ -79,6 +79,6 @@
# qplot() recognises the same options as plot does, and converts them to their
# ggplot2 equivalents. See ?theme for more on ggplot options
# qplot(x, y, data = data, main="title", asp = 1)
# ggplot(data, aes(x, y)) + geom_point() + theme(title = "title", aspect.ratio = 1)
# ggplot(data, aes(x, y)) + geom_point() + labs(title = "title") + theme(aspect.ratio = 1)
}

0 comments on commit 54eeabb

Please sign in to comment.