-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
286 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
--- | ||
output: github_document | ||
--- | ||
|
||
<!-- README.md is generated from README.Rmd. Please edit that file --> | ||
|
||
```{r, echo = FALSE} | ||
knitr::opts_chunk$set( | ||
collapse = TRUE, | ||
comment = "#>", | ||
fig.path = "man/figures/README-" | ||
) | ||
``` | ||
|
||
[![R-CMD-check](https://github.com/jrnold/ggthemes/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jrnold/ggthemes/actions/workflows/R-CMD-check.yaml) | ||
[![Code Coverage Status](https://codecov.io/gh/jrnold/ggthemes/branch/master/graph/badge.svg)](https://codecov.io/github/jrnold/ggthemes?branch=master) | ||
[![rstudio mirror downloads](http://cranlogs.r-pkg.org/badges/ggthemes)](https://github.com/metacran/cranlogs.app) | ||
[![CRAN status](https://www.r-pkg.org/badges/version/ggthemes)](https://CRAN.R-project.org/package=ggthemes) | ||
[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable) | ||
|
||
Some extra geoms, scales, and themes for | ||
[ggplot](https://ggplot2.tidyverse.org/). | ||
|
||
## Install | ||
|
||
To install the stable version from CRAN, | ||
|
||
```r | ||
install.packages('ggthemes', dependencies = TRUE) | ||
``` | ||
|
||
Or, to install the development version from github, use the | ||
**devtools** package, | ||
|
||
```r | ||
library("devtools") | ||
install_github(c("hadley/ggplot2", "jrnold/ggthemes")) | ||
``` | ||
|
||
## How to use | ||
|
||
For a quick tutorial, check out [Rafael Irizarry's book](https://rafalab.github.io/dsbook/ggplot2.html#add-on-packages). | ||
|
||
## Examples | ||
|
||
```{r} | ||
library("ggplot2") | ||
library("ggthemes") | ||
mtcars2 <- within(mtcars, { | ||
vs <- factor(vs, labels = c("V-shaped", "Straight")) | ||
am <- factor(am, labels = c("Automatic", "Manual")) | ||
cyl <- factor(cyl) | ||
gear <- factor(gear) | ||
}) | ||
p1 <- ggplot(mtcars2) + | ||
geom_point(aes(x = wt, y = mpg, colour = gear)) + | ||
labs( | ||
title = "Fuel economy declines as weight increases", | ||
subtitle = "(1973-74)", | ||
caption = "Data from the 1974 Motor Trend US magazine.", | ||
x = "Weight (1000 lbs)", | ||
y = "Fuel economy (mpg)", | ||
colour = "Gears" | ||
) | ||
``` | ||
|
||
```{r,theme_calc} | ||
p1 + | ||
scale_color_calc() + | ||
theme_calc() | ||
``` | ||
|
||
```{r,theme_clean} | ||
p1 + theme_clean() | ||
``` | ||
|
||
```{r,theme_economist} | ||
p1 + theme_economist() + | ||
scale_colour_economist() | ||
``` | ||
|
||
```{r,theme_excel} | ||
p1 + theme_excel() + | ||
scale_colour_excel() | ||
``` | ||
|
||
```{r,theme_excel_new} | ||
p1 + theme_excel_new() + | ||
scale_colour_excel_new() | ||
``` | ||
|
||
```{r,theme_igray} | ||
p1 + theme_igray() | ||
``` | ||
|
||
```{r,theme_par} | ||
p1 + theme_par() | ||
``` | ||
|
||
```{r,theme_fivethirtyeight} | ||
p1 + theme_fivethirtyeight() | ||
``` | ||
|
||
```{r,theme_few} | ||
p1 + theme_few() + | ||
scale_colour_few() | ||
``` | ||
```{r,theme_solarized} | ||
p1 + theme_solarized() + | ||
scale_colour_solarized() | ||
``` | ||
|
||
```{r,theme_solarized_dark} | ||
p1 + theme_solarized(light=FALSE) + | ||
scale_colour_solarized() | ||
``` | ||
|
||
```{r,theme_solid} | ||
p1 + theme_solid() | ||
``` | ||
|
||
```{r,theme_stata} | ||
p1 + theme_tufte() | ||
``` | ||
|
||
```{r,theme_wsj} | ||
p1 + theme_wsj(base_size = 8) + scale_color_wsj() | ||
``` | ||
|
||
```{r,scale_colorblind} | ||
p1 + scale_color_colorblind() | ||
``` | ||
|
||
```{r,scale_color_tableau} | ||
p1 + scale_color_tableau() | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.