Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
Merge branch 'master' of github.com:jrnold/ggthemes

# Conflicts:
#	NEWS
  • Loading branch information
jrnold committed Dec 21, 2015
2 parents f4a2296 + b1e06f3 commit af828e2
Show file tree
Hide file tree
Showing 71 changed files with 169 additions and 75 deletions.
29 changes: 20 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
language: r
language: c
sudo: required

warnings_are_errors: true
before_install:
- curl -OL https://raw.githubusercontent.com/metacran/r-builder/master/pkg-build.sh
- chmod 755 pkg-build.sh
- ./pkg-build.sh bootstrap

# r_check_revdep: true
install:
- ./pkg-build.sh install_github hadley/scales hadley/ggplot2
- ./pkg-build.sh install_deps

r_packages:
- latticeExtra
script:
- ./pkg-build.sh run_tests

r_github_packages:
- hadley/scales
- hadley/ggplot2
- hadley/devtools
after_failure:
- ./pkg-build.sh dump_logs

notifications:
email:
on_success: change
on_failure: change

env:
matrix:
- RVERSION=oldrel
- RVERSION=release
- RVERSION=devel

17 changes: 9 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@ Authors@R: c(person("Jeffrey B.", "Arnold", role = c("aut", "cre"),
comment = "Code from the labeling package"))
Depends:
R (>= 3.0.0),
ggplot2 (>= 2.0.0)
Imports:
assertthat,
colorspace,
ggplot2 (>= 2.0.0),
graphics,
grid,
scales (>= 0.3.0),
methods,
assertthat
scales
Suggests:
knitr,
plyr,
reshape2,
extrafont,
pander,
knitr,
maps,
mapproj
mapproj,
pander,
plyr,
reshape2
VignetteBuilder: knitr
Description: Some extra themes, geoms, and scales for `ggplot2`.
Provides `ggplot2` themes and scales that replicate the look of plots
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ import(stats)
import(utils)
importFrom(graphics,abline)
importFrom(graphics,axis)
importFrom(graphics,par)
importFrom(graphics,points)
importFrom(graphics,text)
importFrom(grid,gList)
Expand Down
8 changes: 5 additions & 3 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ggthemes 3.0.1
------------------------

* Bugfix: Remove border around legends in `theme_gdocs`. Thanks SandyMuspratt! Pull request #53.
* Bugfix: Remove border around legends in `theme_calc`.
Expand All @@ -9,11 +10,12 @@ ggthemes 3.0.0
* For `geom_tufteboxplot` and `GeomTufteboxplot`. Option `median.type` supports only
`line` and `point` options. Added option `whisker.type` which allows for whiskers
to be specified by lines or points.
* Rewrote `stat_fivenumber`
* Changed default stat for `geom_tufteboxplot` to `stat_fivenumber`.
* Added `theme_base` and `theme_par`
* Remove `scale_(x|y)_tufte`. See issue #49
* Removed `scale_(x|y)_tufte`. See issue #49
* `theme_foundation` rewritten. Removed `use_sizes` argument.
* Rewrote Geoms, Stats, and themes to be compatible with `ggplot2` >= 2.0.0
* Import rather than depend on `ggplot2`
* Update geoms, scales, and themes to ggplot >= 2.0.0


ggthemes 2.2.1
Expand Down
6 changes: 4 additions & 2 deletions R/banking.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,13 @@ calc_slopes <- function(x, y, cull = FALSE) {
#' @seealso \code{\link[lattice]{banking}}
#' @export
#' @examples
#' library("ggplot2")
#' # Use the classic sunspot data from Cleveland's orig paper
#' x <- seq_along(sunspot.year)
#' y <- as.numeric(sunspot.year)
#' # Without banking
#' m <- qplot(x, y, geom='line')
#' m <- ggplot(data.frame(x = x, y = y), aes(x = x, y = y)) +
#' geom_line()
#' m
#'
#' ## Using the default method, Median Absolute Slope
Expand Down Expand Up @@ -224,4 +226,4 @@ bank_slopes_lor <- function(slopes, ...) {
nlm(f, alpha0)$estimate
}


2 changes: 2 additions & 0 deletions R/base.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' @export
#' @family themes
#' @examples
#' library("ggplot2")
#' p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg,
#' colour=factor(gear))) + facet_wrap(~am)
#' p + theme_base()
Expand Down Expand Up @@ -382,6 +383,7 @@ theme_base <- function(base_size = 16, base_family = "") {
#' @export
#' @family themes
#' @examples
#' library("ggplot2")
#' p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg,
#' colour=factor(gear))) + facet_wrap(~am)
#' par(font = 2, col.lab = "red", fg = "blue")
Expand Down
2 changes: 2 additions & 0 deletions R/calc.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' @export
#' @family themes calc
#' @examples
#' library("ggplot2")
#' p <- ggplot(mtcars) +
#' geom_point(aes(x = wt, y = mpg, colour=factor(gear))) +
#' facet_wrap(~am) + theme_calc()
Expand Down Expand Up @@ -79,6 +80,7 @@ scale_color_calc <- scale_colour_calc
#' @export
#' @family shapes calc
#' @examples
#' library("ggplot2")
#' show_shapes(calc_shape_pal()(15))
calc_shape_pal <- function() {
values <- ggthemes_data$calc$shapes
Expand Down
1 change: 1 addition & 0 deletions R/colorblind.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#' @seealso The \pkg{dichromat} package, \code{\link[scales]{dichromat_pal}},
#' and \code{\link{scale_color_tableau}} for other colorblind palettes.
#' @examples
#' library("ggplot2")
#' library(scales)
#' show_col(colorblind_pal()(8))
#' p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg,
Expand Down
2 changes: 1 addition & 1 deletion R/economist.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ scale_fill_economist <- function(stata=FALSE, ...) {
#' theme for lattice plots.
#'
#' @examples
#'
#' library("ggplot2")
#' p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg,
#' colour=factor(gear))) +
#' facet_wrap(~am) +
Expand Down
4 changes: 2 additions & 2 deletions R/excel.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' @family colour excel
#' @export
#' @examples
#' library(scales)
#' library("scales")
#' show_col(excel_pal()(8))
#' show_col(excel_pal('fill')(8))
#' show_col(excel_pal('new')(10))
Expand Down Expand Up @@ -63,7 +63,7 @@ scale_color_excel <- scale_colour_excel
#' @export
#' @family themes excel
#' @examples
#'
#' library("ggplot2")
#' # Old line color
#' p <- ggplot(mtcars) +
#' geom_point(aes(x = wt, y = mpg, colour=factor(gear))) +
Expand Down
3 changes: 2 additions & 1 deletion R/few.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' @param palette One of "medium", "dark", or "light"
#' @family colour few
#' @examples
#' library(scales)
#' library("scales")
#' show_col(few_pal()(7))
#' show_col(few_pal("dark")(7))
#' show_col(few_pal("light")(7))
Expand Down Expand Up @@ -60,6 +60,7 @@ scale_fill_few <- function(palette="light", ...) {
#' @family themes few
#' @export
#' @examples
#' library("ggplot2")
#' p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg,
#' colour=factor(gear))) + facet_wrap(~am)
#' p + theme_few() + scale_colour_few()
Expand Down
1 change: 1 addition & 0 deletions R/fivethirtyeight.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ NULL
#' @family themes fivethirtyeight
#' @export
#' @examples
#' library("ggplot2")
#' p <- ggplot(mtcars) +
#' geom_point(aes(x = wt, y = mpg, colour=factor(gear))) +
#' facet_wrap(~am) +
Expand Down
4 changes: 3 additions & 1 deletion R/gdocs.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' @export
#' @family themes gdocs
#' @examples
#' library("ggplot2")
#' p <- ggplot(mtcars) +
#' geom_point(aes(x = wt, y = mpg, colour = factor(gear))) +
#' facet_wrap(~am)
Expand All @@ -29,6 +30,7 @@ theme_gdocs <- function(base_size=12, base_family="sans") {
axis.ticks = element_blank(),
panel.grid.major = element_line(colour = "#CCCCCC"),
panel.grid.minor = element_blank(),
legend.background = element_rect(colour = NA),
legend.key = element_rect(colour = NA),
legend.position = "right",
legend.direction = "vertical")
Expand All @@ -41,7 +43,7 @@ theme_gdocs <- function(base_size=12, base_family="sans") {
#' @family colour gdocs
#' @export
#' @examples
#' library(scales)
#' library("scales")
#' show_col(gdocs_pal()(20))
gdocs_pal <- function() {
manual_pal(unname(ggthemes_data$gdocs))
Expand Down
8 changes: 5 additions & 3 deletions R/geom-rangeframe.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
#'
#' @family geom tufte
#' @examples
#' (ggplot(mtcars, aes(wt, mpg))
#' + geom_point() + geom_rangeframe()
#' + theme_tufte())
#' library("ggplot2")
#' ggplot(mtcars, aes(wt, mpg)) +
#' geom_point() +
#' geom_rangeframe() +
#' theme_tufte()
geom_rangeframe <- function(mapping = NULL, data = NULL, stat = "identity",
position = "identity", sides = "bl",
na.rm = FALSE, show.legend = NA,
Expand Down
1 change: 1 addition & 0 deletions R/geom-tufteboxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#' @export
#'
#' @examples
#' library("ggplot2")
#' p <- ggplot(mtcars, aes(factor(cyl), mpg))
#' ## with a point for the median and lines for whiskers
#' p + geom_tufteboxplot()
Expand Down
1 change: 1 addition & 0 deletions R/ggthemes-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#' @importFrom scales manual_pal div_gradient_pal seq_gradient_pal
#' @importFrom graphics abline axis text points
#' @importFrom methods hasArg as
#' @importFrom graphics par
NULL

# copied from ggplot2
Expand Down
1 change: 1 addition & 0 deletions R/hc.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#' 'darkunica'}, the names of values in
#' \code{ggthemes_data$hc$bg}.
#' @examples
#' library("ggplot2")
#' p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg,
#' colour=factor(gear))) + facet_wrap(~am)
#' p + theme_hc() + scale_colour_hc()
Expand Down
1 change: 1 addition & 0 deletions R/igray.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#' @family themes
#' @seealso \code{\link{theme_gray}}, \code{\link{theme_bw}}
#' @examples
#' library("ggplot2")
#' p <- ggplot(mtcars) +
#' geom_point(aes(x = wt, y = mpg, colour=factor(gear))) +
#' facet_wrap(~am)
Expand Down
7 changes: 5 additions & 2 deletions R/pander.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
#' @param axis axis angle as defined in \code{par(les)}
#' @export
#' @examples \dontrun{
#' p <- qplot(mpg, wt, data = mtcars)
#' require("ggplot2")
#' p <- ggplot2(mtcars, aes(x = mpg, y = wt)) +
#' geom_point()
#' p + theme_pander()
#'
#' panderOptions('graph.grid.color', 'red')
Expand All @@ -28,7 +30,8 @@
#' p + theme_pander() + scale_color_pander()
#'
#' ## standard examples of the ggtheme package
#' qplot(carat, price, data = diamonds, colour = cut) +
#' ggplot(diamonds, aes(x = carat, y = price, colour = cut)) +
#' geom_point() +
#' theme_pander() +
#' scale_colour_pander()
#' ggplot(diamonds, aes(clarity, fill = cut)) +
Expand Down
3 changes: 3 additions & 0 deletions R/shapes.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#' line with an encircled plus sign.
#'
#' @examples
#' library("ggplot2")
#' p <- ggplot(mtcars) +
#' geom_point(aes(x = wt, y = mpg, shape = factor(gear))) +
#' facet_wrap(~am) +
Expand Down Expand Up @@ -98,6 +99,7 @@ scale_shape_cleveland <- function(overlap=TRUE, ...) {
#' "Discriminating Strata in Scatterplots", Journal of
#' the American Statistical Assocation, \url{http://www.jstor.org/stable/2289649}
#' @examples
#' library("ggplot2")
#' (ggplot(mtcars, aes(x=mpg, y=hp, shape=factor(cyl)))
#' + geom_point() + scale_shape_tremmel())
#' @family shapes
Expand Down Expand Up @@ -194,6 +196,7 @@ tremmel_shape_pal <- function(overlap=FALSE, n3alt=TRUE) {
#'
#' @seealso \code{\link{tremmel_shape_pal}} for a description of the palette.
#' @examples
#' library("ggplot2")
#' (ggplot(mtcars, aes(x=mpg, y=hp, shape=factor(cyl)))
#' + geom_point() + scale_shape_tremmel())
#' (ggplot(mtcars, aes(x=mpg, y=hp, shape=factor(cyl)))
Expand Down
4 changes: 2 additions & 2 deletions R/show.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @seealso \code{\link[scales]{show_col}}, \code{\link{show_linetypes}}
#'
#' @examples
#' library(scales)
#' library("scales")
#' show_shapes(shape_pal()(5))
#' show_shapes(shape_pal()(3), labels=TRUE)
#'
Expand Down Expand Up @@ -43,7 +43,7 @@ show_shapes <- function(shapes, labels = TRUE) {
#' @seealso \code{\link[scales]{show_col}}, \code{\link{show_linetypes}}
#'
#' @examples
#' library(scales)
#' library("scales")
#' show_linetypes(linetype_pal()(3))
#' show_linetypes(linetype_pal()(3), labels=TRUE)
show_linetypes <- function(linetypes, labels = TRUE) {
Expand Down
4 changes: 3 additions & 1 deletion R/solarized.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ solarized_accent_list <- function() {
#' @export
#' @family solarized colour
#' @examples
#' library(scales)
#' library("scales")
#' show_col(solarized_pal()(2))
#' show_col(solarized_pal()(3))
#' show_col(solarized_pal('red')(4))
Expand Down Expand Up @@ -79,6 +79,7 @@ solarized_pal <- function(accent = "blue") {
#' @family solarized colour
#' @export
#' @examples
#' library("ggplot2")
#' p <- ggplot(mtcars) +
#' geom_point(aes(x = wt, y = mpg, colour=factor(gear))) +
#' facet_wrap(~am)
Expand Down Expand Up @@ -114,6 +115,7 @@ scale_color_solarized <- scale_colour_solarized
#' @export
#' @family themes solarized
#' @examples
#' library("ggplot2")
#' p <- ggplot(mtcars) +
#' geom_point(aes(x = wt, y = mpg, colour=factor(gear))) +
#' facet_wrap(~am)
Expand Down
Loading

0 comments on commit af828e2

Please sign in to comment.