Permalink
Browse files

cleaning up documentation

  • Loading branch information...
1 parent 3160a29 commit a453bb03e1da98883cfe92630731cba282f8b6d2 @jrnold committed Dec 22, 2012
View
4 R/banking.R
@@ -68,7 +68,7 @@ calc_slopes <- function(x, y, cull=FALSE) {
##' This method finds the aspect ratio by setting the average
##' orientation to 45 degrees. For an aspect ratio
##' \eqn{\alpha}{alpha}, let the orientation of a line segment be
-##' \eqn{\theta_i(\alpha) = \atan(s_i / \alpha)}{theta_i(alpha) = atan(s_i / alpha)}.
+##' \eqn{\theta_i(\alpha) = \arctan(s_i / \alpha)}{theta_i(alpha) = atan(s_i / alpha)}.
##'
##' \deqn{
##' \frac{ \sum_i \theta_i(\alpha) l_i}{\sum_i l_i} = \frac{\pi}{4} rad
@@ -104,7 +104,7 @@ calc_slopes <- function(x, y, cull=FALSE) {
##' The angle between line segments i and j is \eqn{r_{i,j} =
##' \|\theta_i(\alpha) - \theta_j(\alpha)\|}{r_{i,j} = |
##' theta_i(alpha) - theta_j(alpha)|}, where \eqn{\theta_i(\alpha) =
-##' \atan(s_i / \alpha)}{theta_i(alpha) = atan(s_i / \alpha)} and
+##' \arctan(s_i / \alpha)}{theta_i(alpha) = atan(s_i / \alpha)} and
##' \eqn{s_i} is the slope of line segment i. This function finds the
##' \eqn{\alpha} that maximizes the sum of the angles between all
##' pairs of line segments.
View
10 R/colorblind.R
@@ -1,12 +1,14 @@
##' Colorblind Color Palette (Discrete) and Scales
##'
-##' 8-Color Colorblind palette from
-##' \url{http://jfly.iam.u-tokyo.ac.jp/color} and the \href{http://wiki.stdout.org/rcookbook/Graphs/Colors\%20(ggplot2)}{R Cookbook}/
+##' An 8-color colorblind safe qualitative discrete palette from
+##' \url{http://jfly.iam.u-tokyo.ac.jp/color} and the
+##' \href{http://wiki.stdout.org/rcookbook/Graphs/Colors%20(ggplot2)/#a-colorblind-friendly-palette}{Cookbook
+##' for R}.
##'
-##' @rdname colorblind
+##' @rdname colorblind
##' @export
##' @inheritParams ggplot2::scale_colour_hue
-##' @family scales palettes
+##' @family colour
##' @seealso The \pkg{dichromat} package, \code{\link[scales]{dichromat_pal}}, and \code{\link{scale_color_tableau}} for other
##' colorblind palettes.
##' @examples
View
27 R/economist.R
@@ -1,10 +1,9 @@
##' Economist color palette (discrete)
##'
-##' The primary colors are blues, grays, and greens. Red is not
-##' included (early) in these palettes and should be used to indicate
+##' The hues in the palette are blues, grays, and greens. Red is not
+##' included in these palettes and should be used to indicate
##' important data.
##'
-##'
##' @param stata Use the palette in the Stata economist scheme.
##' @param fill Use the fill palette.
##' @family colour economist
@@ -75,8 +74,7 @@ economist_pal <- function(stata=FALSE, fill=TRUE) {
##' Economist color scales
##'
-##' Color scales using the colors in the Economist graphics. These scales use
-##' RGB values and ordering of the colors in the Stata economist scheme.
+##' Color scales using the colors in the Economist graphics.
##'
##' @inheritParams ggplot2::scale_colour_hue
##' @inheritParams economist_pal
@@ -98,7 +96,6 @@ scale_fill_economist <- function(stata=FALSE, ...) {
discrete_scale("fill", "economist", economist_pal(stata=stata), ...)
}
-
##' ggplot color theme based on the Economist
##'
##' Style plots similar to those in \emph{The Economist}.
@@ -108,25 +105,29 @@ scale_fill_economist <- function(stata=FALSE, ...) {
##' \href{http://economist.com}{economist.com}.
##' \code{theme_economist_white} implements a variant with a while
##' panel and light gray (or white) background used by \emph{The Economist}
-##' blog "Graphic Detail".
+##' blog \href{http://www.economist.com/blogs/graphicdetail}{Graphic Detail}.
##'
-##' The Economist uses "ITC Officina Sans" as its font for graphs. If
+##' \emph{The Economist} uses "ITC Officina Sans" as its font for graphs. If
##' you have access to this font, you can use it with the
-##' \bold{extrafont} package. "Verdana" is a good substitute.
+##' \pkg{extrafont} package. "Verdana" is a good substitute.
##'
-##' @param base_size base font size
-##' @param base_family base font family
+##' @param base_size \code{numeric} base font size
+##' @param base_family \code{character} base font family
##' @param horizontal \code{logical}. Horizontal axis lines?
##' @param dkpanel \code{logical} Darker background for panel region?
##' @param stata \code{logical} Use RGB values from Stata's
-##' ##' economist scheme.
-##' @param gray_bg For the white
+##' economist scheme.
+##' @param gray_bg \code{logical} If \code{TRUE}, use gray background, else use white
+##' background.
+##'
+##' @return An object of class \code{\link{theme}}.
##'
##' @export
##' @family themes economist
##'
##' @references
##' \itemize{
+##' \item \href{http://economist.com}{The Economist}
##' \item \href{http://spiekermann.com/en/itc-officina-display/}{Spiekerblog, "ITC Officina Display", January 1, 2007.}
##' \item \url{http://www.economist.com/help/about-us}
##' }
View
18 R/excel.R
@@ -10,7 +10,8 @@
##' \item{new}{Color palette from newer Excel versions.}
##' }
##'
-##' @param palette One of "old", "fill", or "new".
+##' @param palette One of \code{"old"}, \code{"fill"}, or \code{"new"}.
+##' @family colour excel
##' @export
##' @examples
##' library(scales)
@@ -29,9 +30,11 @@ excel_pal <- function(palette="line") {
##' Excel color scales
##'
+##' Color scales from both old and new Excel.
+##'
##' @inheritParams excel_pal
##' @inheritParams ggplot2::scale_colour_hue
-##' @family colour scales
+##' @family colour excel
##' @rdname scale_excel
##' @export
##' @seealso See \code{\link{theme_excel}} for examples.
@@ -56,14 +59,15 @@ scale_color_excel <- scale_colour_excel
##' ggplot color theme based on old Excel plots
##'
-##' Theme to replicate the ugly monstrosity that was the Excel 2003
-##' chart. Please never use this.
+##' Theme to replicate the ugly monstrosity that was the old
+##' gray-background Excel chart. Please never use this.
##'
-##' @param base_size base font size
-##' @param base_family base font family
+##' @param base_size \code{numeric} base font size
+##' @param base_family \code{character} base font family
##' @param horizontal \code{logical}. Horizontal axis lines?
+##' @return An object of class \code{\link{theme}}.
##' @export
-##' @family themes
+##' @family themes excel
##' @examples
##' dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
##' # Old line color palette
View
36 R/few.R
@@ -1,4 +1,4 @@
-##' Palletes from Stephen Few (discrete)
+##' Color Palletes from Few "Practical Rules for Using Color in Charts"
##'
##' Qualitative color palettes from Stephen Few,
##' \href{http://www.perceptualedge.com/articles/visual_business_intelligence/rules_for_using_color.pdf}{"Practical
@@ -25,29 +25,15 @@ few_pal <- function(palette="medium") {
manual_pal(unname(values[2:n]))
}
-##' Few "Practical Rules for Using Color in Charts" color scales
+##' Color scales from Few "Practical Rules for Using Color in Charts"
##'
-##' Qualitative color scales from Stephen Few,
-##' \href{http://www.perceptualedge.com/articles/visual_business_intelligence/rules_for_using_color.pdf}{"Practical
-##' Rules for Using Color in Charts"}.
+##' See \code{\link{few_pal}}.
##'
##' @inheritParams ggplot2::scale_colour_hue
##' @inheritParams few_pal
##' @family colour few
##' @rdname scale_few
##' @export
-##' @examples
-##' dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
-##' (qplot(carat, price, data=dsamp, colour=clarity)
-##' + theme_few()
-##' + scale_colour_few())
-##' (qplot(carat, price, data=dsamp, colour=clarity)
-##' + theme_few()
-##' + scale_colour_few("dark"))
-##' (ggplot(diamonds, aes(clarity, fill=cut))
-##' + geom_bar()
-##' + theme_few()
-##' + scale_fill_few("light"))
scale_colour_few <- function(palette="medium", ...) {
discrete_scale("colour", "few", few_pal(palette), ...)
}
@@ -62,7 +48,7 @@ scale_fill_few <- function(palette="light", ...) {
discrete_scale("fill", "few", few_pal(palette), ...)
}
-##' Theme based on Stephen Few's "Practical Rules for Using Color in Charts"
+##' Theme based on Few's "Practical Rules for Using Color in Charts"
##'
##' Theme based on the rules and examples in
##' \href{http://www.perceptualedge.com/articles/visual_business_intelligence/rules_for_using_color.pdf}{"Practical
@@ -71,8 +57,18 @@ scale_fill_few <- function(palette="light", ...) {
##' @inheritParams ggplot2::theme_bw
##' @family themes few
##' @export
-##'
-##' @seealso \code{\link{scale_colour_few}} for exaples.
+##' @examples
+##' dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
+##' (qplot(carat, price, data=dsamp, colour=clarity)
+##' + theme_few()
+##' + scale_colour_few())
+##' (qplot(carat, price, data=dsamp, colour=clarity)
+##' + theme_few()
+##' + scale_colour_few("dark"))
+##' (ggplot(diamonds, aes(clarity, fill=cut))
+##' + geom_bar()
+##' + theme_few()
+##' + scale_fill_few("light"))
theme_few <- function(base_size=12, base_family="") {
colors <- ggthemes_data$few
gray <- colors$medium['gray']
View
11 R/geom-rangeframe.R
@@ -1,16 +1,9 @@
##' Range Frames
##'
-##' Axis lines which show the maximum and minimum of the data plotted.
+##' Axis lines which extend to the maximum and minimum of the plotted data.
##'
##' @section Aesthetics:
-##' \code{geom_RangeFrame} understands the following aesthetics (required aesthetics are in bold):
-##'
-##' \itemize{
-##' \item \code{alpha}
-##' \item \code{colour}
-##' \item \code{linetype}
-##' \item \code{size}
-##' }
+##' \Sexpr[results=rd,stage=build]{ggthemes:::rd_aesthetics("geom_tufteboxplot", ggthemes:::GeomRangeFrame)}
##'
##' @inheritParams ggplot2::geom_point
##' @param sides A string that controls which sides of the plot the frames appear on.
View
4 R/geom-tufteboxplot.R
@@ -1,9 +1,7 @@
##' Tufte's Box Blot
##'
##' Edward Tufte's revision of the box plot erases the box and
-##' replaces it with a single middle point. What is usually
-##' represented by notches in a standard box plot is represented by a
-##' box with a line for the median.
+##' replaces it with a single point and the whiskers.
##'
##' @section Aesthetics:
##' \Sexpr[results=rd,stage=build]{ggthemes:::rd_aesthetics("geom_tufteboxplot", ggthemes:::GeomTufteboxplot)}
View
52 R/ggthemes-data.R
@@ -1,52 +1,6 @@
##' Palette data for ggthemes package
##'
-##' List with the data used by palettes in the ggthemes package.
-##'
-##' @docType data
-##' @format A \code{list}.
-##' \describe{
-##' \item{economist}{
-##' Colors from The Economist magazine. RGB values taken from
-##' the economist scheme in Stata. \code{bg} are background
-##' colors, \code{fg} are foreground colors.
-##' }
-##' \item{excel}{
-##' \code{list} Various Excel color palettes.
-##' \code{line} The Excel 2003 line color palette.
-##' \code{fill} The Excel 2003 bar chart color palette.
-##' \code{new} Color palette from more recent versions of Excel.
-##' Color RGB values from \url{http://vis.stanford.edu/color-names/analyzer/}.
-##' }
-##' \item{solarized}{
-##' Names and RGB values of the Solarized palette.
-##' \url{http://ethanschoonover.com/solarized}.
-##' \code{base} Base colors.
-##' \code{accent} Accent colors.
-##' }
-##' \item{stata}{
-##' Colors, shapes, and linetypes used by Stata
-##' \code{colors} RBG values of of all Stata colors.
-##' \code{shapes} R shape values of of all Stata symbol types.
-##' \code{linetype} Equivalent R linepattern for all Stata linepattern sytles. \url{http://www.stata.com/help.cgi?symbolstyle}.
-##' }
-##' \item{few}{
-##' Qualitative color palettes from Stephen Few,
-##' \href{http://www.perceptualedge.com/articles/visual_business_intelligence/rules_for_using_color.pdf}{"Practical Rules for Using Color in Charts"}.
-##' He suggests using \code{medium}, except for thin lines and small points, for which use \code{dark}.
-##' }
-##' \item{tableau}{Color and shapes used by Tableau}
-##' \item{manyeyes}{
-##' Color palette from \href{http://www-958.ibm.com/software/data/cognos/manyeyes/}{IBM Many Eyes};
-##' values from \url{http://vis.stanford.edu/color-names/analyzer/}.
-##' }
-##' \item{wsj}{
-##' Colors used in \code{\link{theme_wsj}} and \code{\link{scale_colour_wsj}}.
-##' }
-##' \item{colorblind}{
-##' Colorblind palette from \url{http://jfly.iam.u-tokyo.ac.jp/color/}
-##' }
-##' }
-##'
+##' List with the data used by the palettes in the ggthemes package.
##'
##' @export
ggthemes_data <- {
@@ -543,7 +497,7 @@ ggthemes_data <- {
orange = "#fb832d",
black = "#000000")
- ##
+ ##
x$colorblind <- c(black="#000000",
orange="#E69F00",
sky_blue="#56B4E9",
@@ -552,7 +506,7 @@ ggthemes_data <- {
blue="#0072B2",
vermillion="#D55E00",
reddish_purple="#CC79A7")
-
+
## Return
x
}
View
2 R/ggthemes-package.R
@@ -1,7 +1,7 @@
##' ggthemes
##'
##' This package contains extra themes, scales, and geoms, and
-##' functions for and related to \bold{ggplot2}.
+##' functions for and related to \pkg{ggplot2}.
##'
##' In addtion to the help pages, see the REAMDE page on
##' \href{https://github.com/jrnold/ggthemes}{github} for examples.
View
18 R/igray.R
@@ -1,16 +1,22 @@
##' Inverse gray theme
##'
-##' Inverts the colors in the \code{\link{theme_gray}}, a white panel
-##' and a light gray area around it. This keeps a white background,
-##' but with more gray, it keeps the plot closer to the typographical
-##' color of the document, which was the motivation for using a gray
-##' background in \code{theme_gray}. This is also the style of plots
-##' in Stata and Tableau.
+##' Theme with white panel and gray background.
+##'
+##' @section Details:
+##'
+##' This theme inverts the colors in the \code{\link{theme_gray}}, a
+##' white panel and a light gray area around it. This keeps a white
+##' background for the color scales like \code{\link{theme_bw}}. But
+##' by using a gray background, the plot is closer to the
+##' typographical color of the document, which is the motivation for
+##' using a gray panel in \code{\link{theme_gray}}. This is
+##' similar to the style of plots in Stata and Tableau.
##'
##' @param base_size base font size
##' @param base_family base font family
##' @export
##' @family themes
+##' @seealso \code{\link{theme_gray}}, \code{\link{theme_bw}}
##' @examples
##' dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
##' (d <- qplot(carat, price, data=dsamp, colour=clarity)
View
24 R/shapes.R
@@ -1,24 +1,28 @@
##' Shape palette from Cleveland "Elements of Graphing Data" (discrete).
##'
+##' Shape palettes for overlapping and non-overlapping points.
+##'
##' @param overlap \code{logical} Use the scale for overlapping points?
##'
-##' @note In the Elements of Graphing Data, Cleveland suggests two
-##' shapes palettes for scatter plots: one for overlapping data and
-##' one for non-overlapping data. The pattern for overlapping data
+##' @note
+##'
+##' In the \emph{Elements of Graphing Data}, W.S. Cleveland suggests
+##' two shape palettes for scatter plots: one for overlapping data and
+##' another for non-overlapping data. The symbols for overlapping data
##' relies on pattern discrimination, while the symbols for
-##' non-overlapping data varies the amount of fill. This palatte
+##' non-overlapping data vary the amount of fill. This palatte
##' attempts to create these palettes. However, I found that these
##' were hard to replicate. Using the R shapes and unicode fonts: the
##' symbols can vary in size, they are dependent of the fonts used,
##' and there does not exist a unicode symbol for a circle with a
##' vertical line. If someone can improve this palette, please let me
##' know.
##'
-##' Following Tremmel (1995), I replace the cirlce with a vertical line
-##' with an encircled plus sign.
+##' Following Tremmel (1995), I replace the circle with a vertical
+##' line with an encircled plus sign.
##'
##' @examples
-##' # xoverlapping symbol palette
+##' # overlapping symbol palette
##' dsamp <- diamonds[sample(nrow(diamonds), 100), ]
##' (qplot(carat, price, data=dsamp, shape=cut)
##' + theme_bw() + scale_shape_cleveland())
@@ -27,9 +31,9 @@
##' + theme_bw() + scale_shape_cleveland(overlap=FALSE))
##'
##' @references
-##' Cleveland WS. The Elements of Graphing Data. Revised Edition. Hobart Press, Summit, NJ, 1994, pp. 154-164, 234-239.
-##' @references Tremmel, Lothar, (1995) "The Visual Separability of Plotting Symbols in Scatterplots"
-##' Journal of Computational and Graphical Statistics,
+##' Cleveland WS. \emph{The Elements of Graphing Data}. Revised Edition. Hobart Press, Summit, NJ, 1994, pp. 154-164, 234-239.
+##'
+##' Tremmel, Lothar, (1995) "The Visual Separability of Plotting Symbols in Scatterplots", \emph{Journal of Computational and Graphical Statistics},
##' \url{http://www.jstor.org/stable/1390760}
##'
##' @family shapes
View
29 R/solarized.R
@@ -3,8 +3,10 @@
##' @param light \code{logical} Light theme?
##'
##' Creates the base colors for a light or dark solarized theme. See
-##' \url{http://ethanschoonover.com/solarized}. The idea for this
-##' function comes from the CSS style example.
+##' \url{http://ethanschoonover.com/solarized}. This function is a port
+##' of the CSS style example.
+##'
+##' @keywords internal
solarized_rebase <- function(light=TRUE) {
if (light) {
rebase <- ggthemes_data$solarized$base[c(paste('base', 3:0, sep=''),
@@ -17,15 +19,24 @@ solarized_rebase <- function(light=TRUE) {
rebase
}
+solarized_accent_list <- function() {
+ paste0("\\code{\"", names(ggthemes_data$solarized$accents), "\"}",
+ collapse=",")
+}
+
##' Solarized color palette (discrete)
##'
-##' Solarized accents palette from
-##' \url{http://ethanschoonover.com/solarized}. The colors chosen are
-##' the combination of colors that maximize the total Euclidean
-##' distance between colors in L*a*b space, given a primary accent.
+##' Qualitative color palate based on the Ethan Schoonover's Solarized
+##' palette, \url{http://ethanschoonover.com/solarized}.
+##'
+##' @note
##'
+##' For a given starting color and number of colors in the palette,
+##' the other colors are the combination of colors that maximizes the
+##' total Euclidean distance between colors in L*a*b space.
##'
-##' @param accent \code{character} Primary accent color.
+##' @param accent \code{character} Starting color. One of
+##' \Sexpr[results=rd,stage=build]{ggthemes:::solarized_accent_list()}
##' @export
##' @family solarized colour
##' @examples
@@ -63,9 +74,7 @@ solarized_pal <- function(accent="blue") {
##' Solarized color scales
##'
-##' Accent color theme for Solarized.
-##' Primarily for use with
-##' \code{\link{theme_solarized}}.
+##' See \code{\link{solarized_pal}} for details.
##'
##' @inheritParams ggplot2::scale_colour_hue
##' @inheritParams solarized_pal
View
29 R/stata.R
@@ -1,8 +1,11 @@
##' Stata color palettes (discrete)
##'
-##' Stata color palettes. See Stata documentation for schemes: \url{http://www.stata.com/help.cgi?schemes}
+##' Stata color palettes. See Stata documentation for a description of
+##' the schemes, \url{http://www.stata.com/help.cgi?schemes}.
+##'
+##' @param scheme \code{character}. One of \code{"s2color"},
+##' \code{"s1rcolor"}, \code{"s1color"}, or \code{"mono"}.
##'
-##' @param scheme \code{character}. One of "s2color", "s1rcolor", "s1color", or "mono".
##' @export
##' @family stata colour
##' @examples
@@ -32,7 +35,7 @@ stata_pal <- function(scheme="s2color") {
##' Stata color scales
##'
-##' Color scales using the color palettes from Stata.
+##' See \code{\link{stata_pal}} for details.
##'
##' @inheritParams stata_pal
##' @inheritParams ggplot2::scale_colour_hue
@@ -188,9 +191,7 @@ theme_stata_colors <- function(scheme="s2color") {
plot.background = element_rect(fill = color_plot))
}
-##' ggplot theme based on Stata graph schemes
-##'
-##' Themes which replicate Stata graph schemes.
+##' Themes based on Stata graph schemes
##'
##' @param scheme One of "s2color", "s2mono", "s1color", "s1rcolor", or "s1mono", "s2manual",
##' "s1manual", or "sj"
@@ -199,10 +200,9 @@ theme_stata_colors <- function(scheme="s2color") {
##' @export
##' @family themes stata
##'
-##' @note Stata graph schemes include what ggplot seperates into
-##' themes and scales, as well as defaults specific to different graph
-##' types (which ggplot does not support). These themes should be used
-##' in conjunction with \code{\link{scale_colour_stata}}, see the examples.
+##' @note Stata graph schemes include what \pkg{ggplot2} seperates
+##' into themes and scales, as well as defaults specific to different
+##' graph types (which ggplot does not support).
##'
##' @references \url{http://www.stata.com/help.cgi?schemes}
##'
@@ -244,8 +244,8 @@ theme_stata <- function(scheme="s2color", base_size = 11, base_family = "sans")
##' Stata shape palette (discrete)
##'
-##' Shape palette based on the symbol palette in Stata,
-##' specifically the scheme s2mono.
+##' Shape palette based on the symbol palette in Stata, specifically
+##' that for the scheme s2mono.
##'
##' @export
##' @family shapes stata
@@ -262,8 +262,7 @@ stata_shape_pal <- function() {
##' Stata shape scale
##'
-##' Shape scale palette based on the symbol palette in Stata,
-##' specifically the one in scheme s1mono.
+##' See \code{\link{stata_shape_pal}} for details.
##'
##' @inheritParams ggplot2::scale_x_discrete
##' @family shape stata
@@ -291,7 +290,7 @@ stata_linetype_pal <- function() {
##' Stata linetype palette (discrete)
##'
-##' Linetype scale based on the linepatterns used in Stata.
+##' See \code{\link{stata_linetype_pal}} for details.
##'
##' @inheritParams ggplot2::scale_x_discrete
##' @family linetype stata
View
18 R/tableau.R
@@ -1,7 +1,7 @@
-##' Tableau Color Palettes (discrete)
+##' Color Palettes based on Tableau (discrete)
##'
-##' Color palettes used by
-##' \href{http://www.tableausoftware.com/}{Trableau}.
+##' Color palettes used in
+##' \href{http://www.tableausoftware.com/}{Tableau}.
##'
##' @export
##' @param palette Palette name
@@ -58,8 +58,7 @@ tableau_color_pal <- function(palette = "tableau10") {
##' Tableau color scales.
##'
-##' Color scales used by
-##' \href{http://www.tableausoftware.com/}{Trableau}.
+##' See \code{\link{tableau_color_pal}} for details.
##'
##' @inheritParams ggplot2::scale_colour_hue
##' @inheritParams tableau_color_pal
@@ -94,10 +93,10 @@ scale_fill_tableau <- function (palette = "tableau10", ...) {
#' @rdname scale_color_tableau
scale_color_tableau <- scale_colour_tableau
-##' Tabaleau Shape Palettes (discrete)
+##' Tableau Shape Palettes (discrete)
##'
##' Shape palettes used by
-##' \href{http://www.tableausoftware.com/}{Trableau}.
+##' \href{http://www.tableausoftware.com/}{Tableau}.
##'
##' @export
##' @param palette Palette name
@@ -110,8 +109,7 @@ tableau_shape_pal <- function(palette="default") {
##' Tableau shape scales
##'
-##' Shape scales used by
-##' \href{http://www.tableausoftware.com/}{Trableau}.
+##' See \code{\link{tableau_shape_pal}} for details.
##'
##' @export
##' @inheritParams tableau_shape_pal
@@ -124,5 +122,3 @@ tableau_shape_pal <- function(palette="default") {
scale_shape_tableau <- function (palette = "default", ...) {
discrete_scale("shape", "tableau", tableau_shape_pal(palette), ...)
}
-
-
View
3 R/tufte.R
@@ -1,11 +1,12 @@
-##' Tufte Data-Ink Maximized Theme
+##' Tufte Maximal Data, Minimal Ink Theme
##'
##' Theme based on Chapter 6 "Data-Ink Maximization and Graphical
##' Design" of Edward Tufte *The Visual Display of Quantitative
##' Information*. No border, no axis lines, no grids. This theme works
##' best in combination with \code{\link{geom_rug}} or
##' \code{\link{geom_rangeframe}}.
##'
+##' @note
##' The default font family is set to "serif" as he uses serif fonts
##' for labels in "The Visual Display of Quantitative Information".
##' The serif font used by Tufte in his books is a variant of Bembo,
View
9 R/wsj.R
@@ -1,9 +1,12 @@
##' Wall Street Journal theme
##'
##' Theme based on the plots in \emph{The Wall Street Journal}.
-##' Collections of these plots can be found on the WSJ Graphics
-##' \href{https://twitter.com/WSJGraphics}{Twitter} feed and
-##' \href{http://pinterest.com/wsjgraphics/wsj-graphics/}{Pinterest}.
+##'
+##' @references
+##'
+##' \url{https://twitter.com/WSJGraphics}
+##'
+##' \url{http://pinterest.com/wsjgraphics/wsj-graphics/}
##'
##' @param base_size Base font size.
##' @param color The background color of plot. One of \code{"brown",
View
4 man/bank_slopes.Rd
@@ -61,7 +61,7 @@
This method finds the aspect ratio by setting the average
orientation to 45 degrees. For an aspect ratio
\eqn{\alpha}{alpha}, let the orientation of a line
- segment be \eqn{\theta_i(\alpha) = \atan(s_i /
+ segment be \eqn{\theta_i(\alpha) = \arctan(s_i /
\alpha)}{theta_i(alpha) = atan(s_i / alpha)}.
\deqn{ \frac{ \sum_i \theta_i(\alpha) l_i}{\sum_i l_i} =
@@ -89,7 +89,7 @@
The angle between line segments i and j is \eqn{r_{i,j} =
\|\theta_i(\alpha) - \theta_j(\alpha)\|}{r_{i,j} = |
theta_i(alpha) - theta_j(alpha)|}, where
- \eqn{\theta_i(\alpha) = \atan(s_i /
+ \eqn{\theta_i(\alpha) = \arctan(s_i /
\alpha)}{theta_i(alpha) = atan(s_i / \alpha)} and
\eqn{s_i} is the slope of line segment i. This function
finds the \eqn{\alpha} that maximizes the sum of the
View
42 man/cleveland_shape_pal.Rd
@@ -9,28 +9,28 @@
overlapping points?}
}
\description{
- Shape palette from Cleveland "Elements of Graphing Data"
- (discrete).
+ Shape palettes for overlapping and non-overlapping
+ points.
}
\note{
- In the Elements of Graphing Data, Cleveland suggests two
- shapes palettes for scatter plots: one for overlapping
- data and one for non-overlapping data. The pattern for
- overlapping data relies on pattern discrimination, while
- the symbols for non-overlapping data varies the amount of
- fill. This palatte attempts to create these palettes.
- However, I found that these were hard to replicate. Using
- the R shapes and unicode fonts: the symbols can vary in
- size, they are dependent of the fonts used, and there
- does not exist a unicode symbol for a circle with a
- vertical line. If someone can improve this palette,
- please let me know.
+ In the \emph{Elements of Graphing Data}, W.S. Cleveland
+ suggests two shape palettes for scatter plots: one for
+ overlapping data and another for non-overlapping data.
+ The symbols for overlapping data relies on pattern
+ discrimination, while the symbols for non-overlapping
+ data vary the amount of fill. This palatte attempts to
+ create these palettes. However, I found that these were
+ hard to replicate. Using the R shapes and unicode fonts:
+ the symbols can vary in size, they are dependent of the
+ fonts used, and there does not exist a unicode symbol for
+ a circle with a vertical line. If someone can improve
+ this palette, please let me know.
- Following Tremmel (1995), I replace the cirlce with a
+ Following Tremmel (1995), I replace the circle with a
vertical line with an encircled plus sign.
}
\examples{
-# xoverlapping symbol palette
+# overlapping symbol palette
dsamp <- diamonds[sample(nrow(diamonds), 100), ]
(qplot(carat, price, data=dsamp, shape=cut)
+ theme_bw() + scale_shape_cleveland())
@@ -39,13 +39,13 @@ dsamp <- diamonds[sample(nrow(diamonds), 100), ]
+ theme_bw() + scale_shape_cleveland(overlap=FALSE))
}
\references{
- Cleveland WS. The Elements of Graphing Data. Revised
- Edition. Hobart Press, Summit, NJ, 1994, pp. 154-164,
- 234-239.
+ Cleveland WS. \emph{The Elements of Graphing Data}.
+ Revised Edition. Hobart Press, Summit, NJ, 1994, pp.
+ 154-164, 234-239.
Tremmel, Lothar, (1995) "The Visual Separability of
- Plotting Symbols in Scatterplots" Journal of
- Computational and Graphical Statistics,
+ Plotting Symbols in Scatterplots", \emph{Journal of
+ Computational and Graphical Statistics},
\url{http://www.jstor.org/stable/1390760}
}
\seealso{
View
8 man/colorblind.Rd
@@ -19,10 +19,10 @@
breaks, labels and so forth.}
}
\description{
- 8-Color Colorblind palette from
- \url{http://jfly.iam.u-tokyo.ac.jp/color} and the
- \href{http://wiki.stdout.org/rcookbook/Graphs/Colors\%20(ggplot2)}{R
- Cookbook}/
+ An 8-color colorblind safe qualitative discrete palette
+ from \url{http://jfly.iam.u-tokyo.ac.jp/color} and the
+ \href{http://wiki.stdout.org/rcookbook/Graphs/Colors%20(ggplot2)/#a-colorblind-friendly-palette}{Cookbook
+ for R}.
}
\examples{
library(scales)
View
6 man/economist_pal.Rd
@@ -11,9 +11,9 @@
\item{fill}{Use the fill palette.}
}
\description{
- The primary colors are blues, grays, and greens. Red is
- not included (early) in these palettes and should be used
- to indicate important data.
+ The hues in the palette are blues, grays, and greens. Red
+ is not included in these palettes and should be used to
+ indicate important data.
}
\examples{
library(scales)
View
8 man/excel_pal.Rd
@@ -5,7 +5,8 @@
excel_pal(palette = "line")
}
\arguments{
- \item{palette}{One of "old", "fill", or "new".}
+ \item{palette}{One of \code{"old"}, \code{"fill"}, or
+ \code{"new"}.}
}
\description{
Color palettes from Excel, both current and the pre-2007
@@ -23,4 +24,9 @@ show_col(excel_pal()(8))
show_col(excel_pal("fill")(8))
show_col(excel_pal("new")(10))
}
+\seealso{
+ Other colour excel: \code{\link{scale_color_excel}},
+ \code{\link{scale_colour_excel}},
+ \code{\link{scale_fill_excel}}
+}
View
2 man/few_pal.Rd
@@ -1,6 +1,6 @@
\name{few_pal}
\alias{few_pal}
-\title{Palletes from Stephen Few (discrete)}
+\title{Color Palletes from Few "Practical Rules for Using Color in Charts"}
\usage{
few_pal(palette = "medium")
}
View
11 man/geom_rangeframe.Rd
@@ -38,15 +38,12 @@
for more details.}
}
\description{
- Axis lines which show the maximum and minimum of the data
- plotted.
+ Axis lines which extend to the maximum and minimum of the
+ plotted data.
}
\section{Aesthetics}{
- \code{geom_RangeFrame} understands the following
- aesthetics (required aesthetics are in bold):
-
- \itemize{ \item \code{alpha} \item \code{colour} \item
- \code{linetype} \item \code{size} }
+ \Sexpr[results=rd,stage=build]{ggthemes:::rd_aesthetics("geom_tufteboxplot",
+ ggthemes:::GeomRangeFrame)}
}
\examples{
(ggplot(mtcars, aes(wt, mpg))
View
4 man/geom_tufteboxplot.Rd
@@ -46,9 +46,7 @@
}
\description{
Edward Tufte's revision of the box plot erases the box
- and replaces it with a single middle point. What is
- usually represented by notches in a standard box plot is
- represented by a box with a line for the median.
+ and replaces it with a single point and the whiskers.
}
\section{Aesthetics}{
\Sexpr[results=rd,stage=build]{ggthemes:::rd_aesthetics("geom_tufteboxplot",
View
2 man/ggthemes.Rd
@@ -5,7 +5,7 @@
\title{ggthemes}
\description{
This package contains extra themes, scales, and geoms,
- and functions for and related to \bold{ggplot2}.
+ and functions for and related to \pkg{ggplot2}.
}
\details{
In addtion to the help pages, see the REAMDE page on
View
56 man/ggthemes_data.Rd
@@ -2,54 +2,22 @@
\name{ggthemes_data}
\alias{ggthemes_data}
\title{Palette data for ggthemes package}
-\format{A \code{list}.
-\describe{
-\item{economist}{
-Colors from The Economist magazine. RGB values taken from
-the economist scheme in Stata. \code{bg} are background
-colors, \code{fg} are foreground colors.
-}
-\item{excel}{
-\code{list} Various Excel color palettes.
-\code{line} The Excel 2003 line color palette.
-\code{fill} The Excel 2003 bar chart color palette.
-\code{new} Color palette from more recent versions of Excel.
-Color RGB values from \url{http://vis.stanford.edu/color-names/analyzer/}.
-}
-\item{solarized}{
-Names and RGB values of the Solarized palette.
-\url{http://ethanschoonover.com/solarized}.
-\code{base} Base colors.
-\code{accent} Accent colors.
-}
-\item{stata}{
-Colors, shapes, and linetypes used by Stata
-\code{colors} RBG values of of all Stata colors.
-\code{shapes} R shape values of of all Stata symbol types.
-\code{linetype} Equivalent R linepattern for all Stata linepattern sytles. \url{http://www.stata.com/help.cgi?symbolstyle}.
-}
-\item{few}{
-Qualitative color palettes from Stephen Few,
-\href{http://www.perceptualedge.com/articles/visual_business_intelligence/rules_for_using_color.pdf}{"Practical Rules for Using Color in Charts"}.
-He suggests using \code{medium}, except for thin lines and small points, for which use \code{dark}.
-}
-\item{tableau}{Color and shapes used by Tableau}
-\item{manyeyes}{
-Color palette from \href{http://www-958.ibm.com/software/data/cognos/manyeyes/}{IBM Many Eyes};
-values from \url{http://vis.stanford.edu/color-names/analyzer/}.
-}
-\item{wsj}{
-Colors used in \code{\link{theme_wsj}} and \code{\link{scale_colour_wsj}}.
-}
-\item{colorblind}{
-Colorblind palette from \url{http://jfly.iam.u-tokyo.ac.jp/color/}
-}
-}}
+\format{List of 9
+ $ economist :List of 3
+ $ excel :List of 3
+ $ solarized :List of 2
+ $ stata :List of 3
+ $ few :List of 3
+ $ tableau :List of 2
+ $ manyeyes : chr [1:19] "#9c9ede" "#7375b5" "#4a5584" "#cedb9c" ...
+ $ wsj :List of 2
+ $ colorblind: Named chr [1:8] "#000000" "#E69F00" "#56B4E9" "#009E73" ...
+ ..- attr(*, "names")= chr [1:8] "black" "orange" "sky_blue" "bluish_green" ...}
\usage{
ggthemes_data
}
\description{
- List with the data used by palettes in the ggthemes
+ List with the data used by the palettes in the ggthemes
package.
}
\keyword{datasets}
View
3 man/scale_color_tableau.Rd
@@ -18,8 +18,7 @@
\item{palette}{Palette name}
}
\description{
- Color scales used by
- \href{http://www.tableausoftware.com/}{Trableau}.
+ See \code{\link{tableau_color_pal}} for details.
}
\examples{
dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
View
2 man/scale_economist.Rd
@@ -20,8 +20,6 @@
}
\description{
Color scales using the colors in the Economist graphics.
- These scales use RGB values and ordering of the colors in
- the Stata economist scheme.
}
\seealso{
\code{\link{theme_economist}} for examples.
View
9 man/scale_excel.Rd
@@ -11,14 +11,15 @@
scale_color_excel(palette = "fill", ...)
}
\arguments{
- \item{palette}{One of "old", "fill", or "new".}
+ \item{palette}{One of \code{"old"}, \code{"fill"}, or
+ \code{"new"}.}
\item{...}{Other arguments passed on to
\code{\link{discrete_scale}} to control name, limits,
breaks, labels and so forth.}
}
\description{
- Excel color scales
+ Color scales from both old and new Excel.
}
\examples{
dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
@@ -29,8 +30,6 @@ dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
\seealso{
See \code{\link{theme_excel}} for examples.
- Other colour scales: \code{\link{scale_color_solarized}},
- \code{\link{scale_colour_solarized}},
- \code{\link{scale_fill_solarized}}
+ Other colour excel: \code{\link{excel_pal}}
}
View
19 man/scale_few.Rd
@@ -2,7 +2,7 @@
\alias{scale_color_few}
\alias{scale_colour_few}
\alias{scale_fill_few}
-\title{Few "Practical Rules for Using Color in Charts" color scales}
+\title{Color scales from Few "Practical Rules for Using Color in Charts"}
\usage{
scale_colour_few(palette = "medium", ...)
@@ -18,22 +18,7 @@
\item{palette}{One of "medium", "dark", or "light"}
}
\description{
- Qualitative color scales from Stephen Few,
- \href{http://www.perceptualedge.com/articles/visual_business_intelligence/rules_for_using_color.pdf}{"Practical
- Rules for Using Color in Charts"}.
-}
-\examples{
-dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
-(qplot(carat, price, data=dsamp, colour=clarity)
-+ theme_few()
-+ scale_colour_few())
-(qplot(carat, price, data=dsamp, colour=clarity)
-+ theme_few()
-+ scale_colour_few("dark"))
-(ggplot(diamonds, aes(clarity, fill=cut))
-+ geom_bar()
-+ theme_few()
-+ scale_fill_few("light"))
+ See \code{\link{few_pal}}.
}
\seealso{
Other colour few: \code{\link{few_pal}}
View
2 man/scale_linetype_stata.Rd
@@ -11,7 +11,7 @@
\code{\link{discrete_scale}} for more details}
}
\description{
- Linetype scale based on the linepatterns used in Stata.
+ See \code{\link{stata_linetype_pal}} for details.
}
\examples{
library(reshape2) # for melt
View
3 man/scale_shape_stata.Rd
@@ -11,8 +11,7 @@
\code{\link{discrete_scale}} for more details}
}
\description{
- Shape scale palette based on the symbol palette in Stata,
- specifically the one in scheme s1mono.
+ See \code{\link{stata_shape_pal}} for details.
}
\examples{
dsmall <- diamonds[sample(nrow(diamonds), 100), ]
View
3 man/scale_shape_tableau.Rd
@@ -13,8 +13,7 @@
\code{\link{discrete_scale}} for more details}
}
\description{
- Shape scales used by
- \href{http://www.tableausoftware.com/}{Trableau}.
+ See \code{\link{tableau_shape_pal}} for details.
}
\examples{
dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
View
10 man/scale_solarized.Rd
@@ -15,11 +15,11 @@
\code{\link{discrete_scale}} to control name, limits,
breaks, labels and so forth.}
- \item{accent}{\code{character} Primary accent color.}
+ \item{accent}{\code{character} Starting color. One of
+ \Sexpr[results=rd,stage=build]{ggthemes:::solarized_accent_list()}}
}
\description{
- Accent color theme for Solarized. Primarily for use with
- \code{\link{theme_solarized}}.
+ See \code{\link{solarized_pal}} for details.
}
\examples{
dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
@@ -28,10 +28,6 @@ dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
+ scale_colour_solarized() )
}
\seealso{
- Other colour scales: \code{\link{scale_color_excel}},
- \code{\link{scale_colour_excel}},
- \code{\link{scale_fill_excel}}
-
Other solarized colour: \code{\link{solarized_pal}}
}
View
6 man/scale_stata.Rd
@@ -11,15 +11,15 @@
scale_color_stata(scheme = "s2color", ...)
}
\arguments{
- \item{scheme}{\code{character}. One of "s2color",
- "s1rcolor", "s1color", or "mono".}
+ \item{scheme}{\code{character}. One of \code{"s2color"},
+ \code{"s1rcolor"}, \code{"s1color"}, or \code{"mono"}.}
\item{...}{Other arguments passed on to
\code{\link{discrete_scale}} to control name, limits,
breaks, labels and so forth.}
}
\description{
- Color scales using the color palettes from Stata.
+ See \code{\link{stata_pal}} for details.
}
\examples{
dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
View
17 man/solarized_pal.Rd
@@ -5,14 +5,19 @@
solarized_pal(accent = "blue")
}
\arguments{
- \item{accent}{\code{character} Primary accent color.}
+ \item{accent}{\code{character} Starting color. One of
+ \Sexpr[results=rd,stage=build]{ggthemes:::solarized_accent_list()}}
}
\description{
- Solarized accents palette from
- \url{http://ethanschoonover.com/solarized}. The colors
- chosen are the combination of colors that maximize the
- total Euclidean distance between colors in L*a*b space,
- given a primary accent.
+ Qualitative color palate based on the Ethan Schoonover's
+ Solarized palette,
+ \url{http://ethanschoonover.com/solarized}.
+}
+\note{
+ For a given starting color and number of colors in the
+ palette, the other colors are the combination of colors
+ that maximizes the total Euclidean distance between
+ colors in L*a*b space.
}
\examples{
library(scales)
View
4 man/solarized_rebase.Rd
@@ -9,10 +9,10 @@
Creates the base colors for a light or dark solarized
theme. See \url{http://ethanschoonover.com/solarized}.
- The idea for this function comes from the CSS style
- example.}
+ This function is a port of the CSS style example.}
}
\description{
Base colors for Solarized light and dark themes
}
+\keyword{internal}
View
9 man/stata_pal.Rd
@@ -5,12 +5,13 @@
stata_pal(scheme = "s2color")
}
\arguments{
- \item{scheme}{\code{character}. One of "s2color",
- "s1rcolor", "s1color", or "mono".}
+ \item{scheme}{\code{character}. One of \code{"s2color"},
+ \code{"s1rcolor"}, \code{"s1color"}, or \code{"mono"}.}
}
\description{
- Stata color palettes. See Stata documentation for
- schemes: \url{http://www.stata.com/help.cgi?schemes}
+ Stata color palettes. See Stata documentation for a
+ description of the schemes,
+ \url{http://www.stata.com/help.cgi?schemes}.
}
\examples{
library(scales)
View
2 man/stata_shape_pal.Rd
@@ -6,7 +6,7 @@
}
\description{
Shape palette based on the symbol palette in Stata,
- specifically the scheme s2mono.
+ specifically that for the scheme s2mono.
}
\seealso{
See \code{\link{scale_shape_stata}} for examples.
View
6 man/tableau_color_pal.Rd
@@ -1,15 +1,15 @@
\name{tableau_color_pal}
\alias{tableau_color_pal}
-\title{Tableau Color Palettes (discrete)}
+\title{Color Palettes based on Tableau (discrete)}
\usage{
tableau_color_pal(palette = "tableau10")
}
\arguments{
\item{palette}{Palette name}
}
\description{
- Color palettes used by
- \href{http://www.tableausoftware.com/}{Trableau}.
+ Color palettes used in
+ \href{http://www.tableausoftware.com/}{Tableau}.
}
\examples{
library(scales)
View
4 man/tableau_shape_pal.Rd
@@ -1,6 +1,6 @@
\name{tableau_shape_pal}
\alias{tableau_shape_pal}
-\title{Tabaleau Shape Palettes (discrete)}
+\title{Tableau Shape Palettes (discrete)}
\usage{
tableau_shape_pal(palette = "default")
}
@@ -9,7 +9,7 @@
}
\description{
Shape palettes used by
- \href{http://www.tableausoftware.com/}{Trableau}.
+ \href{http://www.tableausoftware.com/}{Tableau}.
}
\examples{
show_shapes(tableau_shape_pal()(5))
View
25 man/theme_economist.Rd
@@ -11,19 +11,23 @@
horizontal = TRUE)
}
\arguments{
- \item{base_size}{base font size}
+ \item{base_size}{\code{numeric} base font size}
- \item{base_family}{base font family}
+ \item{base_family}{\code{character} base font family}
\item{horizontal}{\code{logical}. Horizontal axis lines?}
\item{dkpanel}{\code{logical} Darker background for panel
region?}
\item{stata}{\code{logical} Use RGB values from Stata's
- ##' economist scheme.}
+ economist scheme.}
- \item{gray_bg}{For the white}
+ \item{gray_bg}{\code{logical} If \code{TRUE}, use gray
+ background, else use white background.}
+}
+\value{
+ An object of class \code{\link{theme}}.
}
\description{
Style plots similar to those in \emph{The Economist}.
@@ -35,11 +39,13 @@
\href{http://economist.com}{economist.com}.
\code{theme_economist_white} implements a variant with a
while panel and light gray (or white) background used by
- \emph{The Economist} blog "Graphic Detail".
+ \emph{The Economist} blog
+ \href{http://www.economist.com/blogs/graphicdetail}{Graphic
+ Detail}.
- The Economist uses "ITC Officina Sans" as its font for
- graphs. If you have access to this font, you can use it
- with the \bold{extrafont} package. "Verdana" is a good
+ \emph{The Economist} uses "ITC Officina Sans" as its font
+ for graphs. If you have access to this font, you can use
+ it with the \pkg{extrafont} package. "Verdana" is a good
substitute.
}
\examples{
@@ -86,7 +92,8 @@ library(extrafont)
}
}
\references{
- \itemize{ \item
+ \itemize{ \item \href{http://economist.com}{The
+ Economist} \item
\href{http://spiekermann.com/en/itc-officina-display/}{Spiekerblog,
"ITC Officina Display", January 1, 2007.} \item
\url{http://www.economist.com/help/about-us} }
View
15 man/theme_excel.Rd
@@ -6,15 +6,18 @@
base_family = "")
}
\arguments{
- \item{base_size}{base font size}
+ \item{base_size}{\code{numeric} base font size}
- \item{base_family}{base font family}
+ \item{base_family}{\code{character} base font family}
\item{horizontal}{\code{logical}. Horizontal axis lines?}
}
+\value{
+ An object of class \code{\link{theme}}.
+}
\description{
- Theme to replicate the ugly monstrosity that was the
- Excel 2003 chart. Please never use this.
+ Theme to replicate the ugly monstrosity that was the old
+ gray-background Excel chart. Please never use this.
}
\examples{
dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
@@ -28,8 +31,4 @@ dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
+ scale_fill_excel("fill")
+ theme_excel())
}
-\seealso{
- Other themes: \code{\link{theme_foundation}},
- \code{\link{theme_igray}}
-}
View
16 man/theme_few.Rd
@@ -1,6 +1,6 @@
\name{theme_few}
\alias{theme_few}
-\title{Theme based on Stephen Few's "Practical Rules for Using Color in Charts"}
+\title{Theme based on Few's "Practical Rules for Using Color in Charts"}
\usage{
theme_few(base_size = 12, base_family = "")
}
@@ -14,7 +14,17 @@
\href{http://www.perceptualedge.com/articles/visual_business_intelligence/rules_for_using_color.pdf}{"Practical
Rules for Using Color in Charts"}.
}
-\seealso{
- \code{\link{scale_colour_few}} for exaples.
+\examples{
+dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
+(qplot(carat, price, data=dsamp, colour=clarity)
++ theme_few()
++ scale_colour_few())
+(qplot(carat, price, data=dsamp, colour=clarity)
++ theme_few()
++ scale_colour_few("dark"))
+(ggplot(diamonds, aes(clarity, fill=cut))
++ geom_bar()
++ theme_few()
++ scale_fill_few("light"))
}
View
3 man/theme_foundation.Rd
@@ -27,7 +27,6 @@
hierarchy.
}
\seealso{
- Other themes: \code{\link{theme_excel}},
- \code{\link{theme_igray}}
+ Other themes: \code{\link{theme_igray}}
}
View
23 man/theme_igray.Rd
@@ -10,21 +10,26 @@
\item{base_family}{base font family}
}
\description{
- Inverts the colors in the \code{\link{theme_gray}}, a
- white panel and a light gray area around it. This keeps a
- white background, but with more gray, it keeps the plot
- closer to the typographical color of the document, which
- was the motivation for using a gray background in
- \code{theme_gray}. This is also the style of plots in
- Stata and Tableau.
+ Theme with white panel and gray background.
+}
+\section{Details}{
+ This theme inverts the colors in the
+ \code{\link{theme_gray}}, a white panel and a light gray
+ area around it. This keeps a white background for the
+ color scales like \code{\link{theme_bw}}. But by using a
+ gray background, the plot is closer to the typographical
+ color of the document, which is the motivation for using
+ a gray panel in \code{\link{theme_gray}}. This is similar
+ to the style of plots in Stata and Tableau.
}
\examples{
dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
(d <- qplot(carat, price, data=dsamp, colour=clarity)
+ theme_igray())
}
\seealso{
- Other themes: \code{\link{theme_excel}},
- \code{\link{theme_foundation}}
+ \code{\link{theme_gray}}, \code{\link{theme_bw}}
+
+ Other themes: \code{\link{theme_foundation}}
}
View
10 man/theme_stata.Rd
@@ -1,6 +1,6 @@
\name{theme_stata}
\alias{theme_stata}
-\title{ggplot theme based on Stata graph schemes}
+\title{Themes based on Stata graph schemes}
\usage{
theme_stata(scheme = "s2color", base_size = 11,
base_family = "sans")
@@ -14,14 +14,12 @@
\item{base_family}{base font family}
}
\description{
- Themes which replicate Stata graph schemes.
+ Themes based on Stata graph schemes
}
\note{
- Stata graph schemes include what ggplot seperates into
- themes and scales, as well as defaults specific to
+ Stata graph schemes include what \pkg{ggplot2} seperates
+ into themes and scales, as well as defaults specific to
different graph types (which ggplot does not support).
- These themes should be used in conjunction with
- \code{\link{scale_colour_stata}}, see the examples.
}
\examples{
dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
View
4 man/theme_tufte.Rd
@@ -1,6 +1,6 @@
\name{theme_tufte}
\alias{theme_tufte}
-\title{Tufte Data-Ink Maximized Theme}
+\title{Tufte Maximal Data, Minimal Ink Theme}
\usage{
theme_tufte(ticks = TRUE, base_family = "serif",
base_size = 11)
@@ -19,7 +19,7 @@
grids. This theme works best in combination with
\code{\link{geom_rug}} or \code{\link{geom_rangeframe}}.
}
-\details{
+\note{
The default font family is set to "serif" as he uses
serif fonts for labels in "The Visual Display of
Quantitative Information". The serif font used by Tufte
View
10 man/theme_wsj.Rd
@@ -18,10 +18,7 @@
}
\description{
Theme based on the plots in \emph{The Wall Street
- Journal}. Collections of these plots can be found on the
- WSJ Graphics
- \href{https://twitter.com/WSJGraphics}{Twitter} feed and
- \href{http://pinterest.com/wsjgraphics/wsj-graphics/}{Pinterest}.
+ Journal}.
}
\examples{
(qplot(hp, mpg, data=mtcars, geom="point")
@@ -34,4 +31,9 @@
+ ggtitle("Diamond Prices")
+ theme_wsj(color="gray"))
}
+\references{
+ \url{https://twitter.com/WSJGraphics}
+
+ \url{http://pinterest.com/wsjgraphics/wsj-graphics/}
+}

0 comments on commit a453bb0

Please sign in to comment.