• Stars
    star
    1,253
  • Rank 36,522 (Top 0.8 %)
  • Language
    R
  • Created almost 12 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Additional themes, scales, and geoms for ggplot2

R-CMD-check Code Coverage Status rstudio mirror downloads CRAN status lifecycle

Some extra geoms, scales, and themes for ggplot.

Install

To install the stable version from CRAN,

install.packages('ggthemes', dependencies = TRUE)

Or, to install the development version from github, use the devtools package,

library("devtools")
install_github(c("hadley/ggplot2", "jrnold/ggthemes"))

How to use

For a quick tutorial, check out Rafael Irizarry’s book.

Examples

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"
  )
p1 +
  scale_color_calc() +
  theme_calc()

p1 + theme_clean()

p1 + theme_economist() +
  scale_colour_economist()

p1 + theme_excel() +
  scale_colour_excel()

p1 + theme_excel_new() +
  scale_colour_excel_new()

p1 + theme_igray()

p1 + theme_par()

p1 + theme_fivethirtyeight()

p1 + theme_few() +
  scale_colour_few()

p1 + theme_solarized() +
  scale_colour_solarized()

p1 + theme_solarized(light=FALSE) +
  scale_colour_solarized()

p1 + theme_solid()

p1 + theme_tufte()

p1 + theme_wsj(base_size = 8) + scale_color_wsj()

p1 + scale_color_colorblind()

p1 + scale_color_tableau()

More Repositories

1

r4ds-exercise-solutions

Exercise solutions to "R for Data Science"
R
315
star
2

beamercolorthemesolarized

Beamer color theme using the Solarized palette
TeX
121
star
3

masteringmetrics

R code for Angrist & Pischke Mastering Metrics
R
75
star
4

ssmodels-in-stan

State space models (dynamic linear models, hidden Markov models) implemented in Stan.
Stan
45
star
5

CDB90

CDB90 battle dataset
HTML
41
star
6

qss-tidy

tidyverse code for QSS
R
37
star
7

bayesian_notes

TeX
35
star
8

resamplr

R package cross-validation, bootstrap, permutation, and rolling window resampling techniques for the tidyverse.
R
34
star
9

docker-stan

Dockerfiles with rstan and CmdStan
Makefile
23
star
10

acw_battle_data

HTML
18
star
11

intro-methods-notes

Notes for political science introductory methods sequence
TeX
16
star
12

yasnippet-ess

ess-mode snippets for yasnippet
15
star
13

bugs-examples-in-stan

Simon Jackman's "BUGS Examples" translated into Stan
HTML
15
star
14

psmanuscripts

R markdown formats for political science manuscripts
TeX
14
star
15

stan-language-definitions

Stan keywords and functions; used to create editor language modes and syntax highlighters
Python
11
star
16

civil_war_era_findata

Civil War (U.S.) era financial and economic data
R
11
star
17

ggtufte

Geoms and themes for ggplot2 inspired by Tufte
R
9
star
18

mlspearer

Infrastructure for resampling, permuation, and cross-validation in R
R
8
star
19

irdata

International Relations Database
Python
8
star
20

rethinking-stats

Stan
6
star
21

marfx

R
6
star
22

afrobarometer

R scripts to clean and merge Afrobarometer survey data across rounds
R
5
star
23

lstbayes

Language drivers for BUGS, JAGS, and Stan for the LaTeX package listings.
TeX
5
star
24

ShinyIntroStats

Some Shiny apps for introductory statistics
R
5
star
25

dlm-shrinkage

Replication for Shinkage in Bayesian Dynamic Linear Models
HTML
4
star
26

tree-sitter-stan

Stan grammar for tree-sitter
C
3
star
27

U-of-Rochester-TikZ-logo

University of Rochester logo in TikZ
3
star
28

textools

R
3
star
29

r-smss

R package with datasets from Agresti and Finlay "Statistical Methods for the Social Sciences"
R
3
star
30

groundcontrol

An R package to generate data-only R packages of flight data, like nycflights13, but with a choice of airport(s) and year(s).
R
3
star
31

csss-static-site

HTML
2
star
32

wikidit

Jupyter Notebook
2
star
33

priestley

Biographical Data used in Joseph Priestley's "A Chart of History"
Jupyter Notebook
2
star
34

acw_onset_markets

JavaScript
2
star
35

r-proto-gibbs

Gibbs sampler in R with proto
R
2
star
36

example_game_trees_with_tikz

I don't do games much anymore, but when I did, I made the game trees with tikz
TeX
2
star
37

r-checker

R package: Data frames with column and table constraints.
R
2
star
38

psc585

Dynamic and Computation Modeling
Python
2
star
39

jabref-econ-journal-abbrevs

Economics journal abbreviations (JEL) for JabRef
2
star
40

fivemat

Better formatting for numbers in R
R
2
star
41

pygments_bugs

Pygment lexer for Stan models
Python
2
star
42

afrobarometer-languages

Mappings between languages in the Afrobarometer survey and canonical language datasets (ISO, WALS)
R
2
star
43

mars-submit

2
star
44

r-strat

statistical strategic models in R
Shell
2
star
45

PAR

Data from US Army CAA "Personnel Attrition Rates in Historical Land Combat Operations" (1994)
1
star
46

stanhighlightexamples

TeX
1
star
47

bayz

R
1
star
48

examiner

R
1
star
49

DataFrameConstr

R package with classes for data frames with column constraints, and lists requiring all elements to have the same class.
R
1
star
50

bookdown-github-issues

Simple example application of using javascript to allow readers of webpage to submit GitHub issues with selected text.
JavaScript
1
star
51

financial_markets_and_empirical_study_of_war

Notes for presentation for a workshop for the Peace Science Society (International) Meeting 2014.
1
star
52

nikola_rmarkdown

nikola plugin for R mark
Python
1
star
53

cv

Source files for my curriculum vitae
HTML
1
star
54

bps5data

R
1
star
55

emacs-dot-files

My emacs dot files
Emacs Lisp
1
star
56

KFAS

Fork of the R package KFAS
Fortran
1
star
57

fatsecretExporter

exports fatsecret data to csv
Python
1
star
58

playfair-data

Data from William Playfair's works
R
1
star
59

mcmcdb

R package for storing and accessing MCMC samples
R
1
star
60

prettify-lang-r-bugs

Prettify language support for R/Splus, BUGS/JAGS, and Stan
JavaScript
1
star
61

CSSS_Stuff

Data on CSSS working papers and seminar series
Python
1
star
62

stan_headers

Reusable Stan code in CPP macros
1
star
63

color-theme-brewer

Emacs color themes based on colorbrewer palettes
Emacs Lisp
1
star
64

jrnold-latex

Miscellaneous LaTeX packages
1
star
65

insight-ds-docker

Jupyter Notebook
1
star
66

stataXml

R package to read/write Stata xml format datasets
1
star
67

raycast-notion-quick-notes

Raycast extension to quickly save notes to notion
TypeScript
1
star