Giter VIP home page Giter VIP logo

ggthemes's Introduction

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()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.