Package ggdark. R topics documented: January 11, Type Package Title Dark Mode for 'ggplot2' Themes Version Author Neal Grantham

Similar documents
Intro to R for Epidemiologists

Package harrypotter. September 3, 2018

Package nima. May 23, 2018

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package gameofthrones

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package ggextra. April 4, 2018

Package spark. July 21, 2017

Package dotwhisker. R topics documented: June 28, Type Package

Package autocogs. September 22, Title Automatic Cognostic Summaries Version 0.1.1

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package ggrepel. September 30, 2017

Package docxtools. July 6, 2018

Package memery. February 13, 2018

Package WordR. September 7, 2017

Package cowplot. March 6, 2016

Package meme. November 2, 2017

Package DataExplorer

Adding a corporate identity to reproducible research

Package gridextra. September 9, 2017

Package infer. July 11, Type Package Title Tidy Statistical Inference Version 0.3.0

Package messaging. May 27, 2018

Package meme. December 6, 2017

grammar statistical graphics Building a in Clojure Kevin Lynagh 2012 November 9 Øredev Keming Labs Malmö, Sweden

Getting started with ggplot2

Package labelvector. July 28, 2018

ggplot in 3 easy steps (maybe 2 easy steps)

Package sankey. R topics documented: October 22, 2017

Package lvplot. August 29, 2016

Package semantic.dashboard

Package pairsd3. R topics documented: August 29, Title D3 Scatterplot Matrices Version 0.1.0

Package vdiffr. April 27, 2018

DATA VISUALIZATION WITH GGPLOT2. Grid Graphics

Package datasets.load

Package kirby21.base

Package ggseas. June 12, 2018

Plotting with ggplot2: Part 2. Biostatistics

Package repec. August 31, 2018

Package ggloop. October 20, 2016

Package IATScore. January 10, 2018

Package crossword.r. January 19, 2018

Package fastdummies. January 8, 2018

Package Mondrian. R topics documented: March 4, Type Package

Package vip. June 15, 2018

Rstudio GGPLOT2. Preparations. The first plot: Hello world! W2018 RENR690 Zihaohan Sang

Package lemon. September 12, 2017

Package reghelper. April 8, 2017

Visualizing Data: Customization with ggplot2

Package projector. February 27, 2018

Facets and Continuous graphs

Package wrswor. R topics documented: February 2, Type Package

Package nodbi. August 1, 2018

Package d3plus. September 25, 2017

Package SEMrushR. November 3, 2018

Package comparedf. February 11, 2019

Package ECctmc. May 1, 2018

Package filelock. R topics documented: February 7, 2018

Package humanize. R topics documented: April 4, Version Title Create Values for Human Consumption

Package panelview. April 24, 2018

Package statsdk. September 30, 2017

Package available. November 17, 2017

Package customlayout

Package canvasxpress

Package facerec. May 14, 2018

Package tidyimpute. March 5, 2018

Package knitrbootstrap

Package condusco. November 8, 2017

Package farver. November 20, 2018

Data visualization with ggplot2

Package zeallot. R topics documented: September 28, Type Package

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package assertr. R topics documented: February 23, Type Package

Package packcircles. April 28, 2018

Package effectr. January 17, 2018

Package clusternomics

Package edfreader. R topics documented: May 21, 2017

Package superheat. February 4, 2017

Package gtrendsr. October 19, 2017

Package websearchr. R topics documented: October 23, 2018

Package palettetown. April 7, 2016

Package validara. October 19, 2017

Package GGEBiplots. July 24, 2017

Package TVsMiss. April 5, 2018

Package rsppfp. November 20, 2018

Package jrt. January 4, 2019

Package slickr. March 6, 2018

Package glue. March 12, 2019

Package spelling. December 18, 2017

Package plotluck. November 13, 2016

Package geogrid. August 19, 2018

Package rwars. January 14, 2017

Package dbx. July 5, 2018

Package fitbitscraper

Package catchr. R topics documented: December 30, Type Package. Title Catch, Collect, and Raise Conditions. Version 0.1.0

Package interplot. R topics documented: June 30, 2018

Package lcc. November 16, 2018

Package bisect. April 16, 2018

Package TrajDataMining

Package githubinstall

Transcription:

Type Package Title Dark Mode for 'ggplot2' Themes Version 0.2.1 Author Neal Grantham Package ggdark January 11, 2019 Maintainer Neal Grantham <neal@nsgrantham.com> Activate dark mode on your favorite 'ggplot2' theme with dark_mode() or use the dark versions of 'ggplot2' themes, including dark_theme_gray(), dark_theme_minimal(), and others. When a dark theme is applied, all geom color and geom fill defaults are changed to make them visible against a dark background. To restore the defaults to their original values, use invert_geom_defaults(). License MIT + file LICENSE Depends R (>= 3.1) Imports ggplot2 (>= 3.0) Suggests testthat Encoding UTF-8 LazyData true RoxygenNote 6.1.0 NeedsCompilation no Repository CRAN Date/Publication 2019-01-11 17:30:06 UTC R topics documented: dark_mode......................................... 2 ggdark............................................ 3 ggdarktheme........................................ 3 invert_color......................................... 5 invert_geom_defaults.................................... 6 invert_theme_elements................................... 7 1

2 dark_mode Index 8 dark_mode Activate dark mode on a ggplot2 theme Activate dark mode on a ggplot2 theme dark_mode(.theme = theme_get(), verbose = TRUE, force_geom_invert = FALSE).theme verbose ggplot2 theme object print messages (default: TRUE) force_geom_invert Force the inversion of geom defaults for fill and color/colour (default: FALSE) Value dark version of theme Examples library(ggplot2) p1 <- ggplot(iris, aes(sepal.width, Sepal.Length, color = Species)) + geom_point() p1 # theme returned by theme_get() p1 + dark_mode() # activate dark mode on theme returned by theme_get() p2 <- ggplot(iris, aes(sepal.width, Sepal.Length)) + geom_point() + facet_wrap(~ Species) p2 + dark_mode(theme_minimal()) # activate dark mode on another theme invert_geom_defaults() # restore geom defaults to their original values

ggdark 3 ggdark ggdark : Dark mode for ggplot2 Use dark_mode() on your favorite ggplot2 theme to activate its dark mode. ggdark also provides dark versions of the themes included in ggplot2 : dark_theme_grey(), dark_theme_bw(), dark_theme_minimal(), and others. When a dark theme is applied, all geom color and geom fill defaults are inverted to make them visible against a dark background. To change them back, use invert_geom_defaults(). ggdarktheme Complete dark themes These are dark versions of complete themes from ggplot2 which control all non-data display. Use theme() if you just need to tweak the display of an existing theme. dark_theme_bw(base_size = 11, base_family = "", dark_theme_classic(base_size = 11, base_family = "", dark_theme_gray(base_size = 11, base_family = "", dark_theme_grey(base_size = 11, base_family = "", dark_theme_minimal(base_size = 11, base_family = "", dark_theme_light(base_size = 11, base_family = "", dark_theme_dark(base_size = 11, base_family = "", dark_theme_void(base_size = 11, base_family = "",

4 ggdarktheme dark_theme_test(base_size = 11, base_family = "", dark_theme_linedraw(base_size = 11, base_family = "", Details base_size base_family base font size base font family base_line_size base size for line elements base_rect_size base size for rect elements dark_theme_gray Dark version of theme_gray(), the signature ggplot2 theme with a grey background and white gridlines, designed to put the data forward yet make comparisons easy. dark_theme_bw Dark version of theme_bw(), the classic dark-on-light ggplot2 theme. May work better for presentations displayed with a projector. dark_theme_linedraw Dark version of theme_linedraw(), a theme with only black lines of various widths on white backgrounds, reminiscent of a line drawings. Serves a purpose similar to theme_bw(). Note that this theme has some very thin lines («1 pt) which some journals may refuse. dark_theme_light Dark version of theme_light(), a theme similar to theme_linedraw() but with light grey lines and axes, to direct more attention towards the data. dark_theme_dark Dark verion of theme_dark(), the dark cousin of theme_light(), with similar line sizes but a dark background. Useful to make thin coloured lines pop out. dark_theme_minimal Dark version of theme_minimal(), a minimalistic theme with no background annotations. dark_theme_classic Dark version of theme_classic(), a classic-looking theme, with x and y axis lines and no gridlines. dark_theme_void Dark version of theme_void(), a completely empty theme. dark_theme_test Dark version of theme_test(), a theme for visual unit tests. It should ideally never change except for new features. Examples library(ggplot2) 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) +

invert_color 5 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.", tag = "Figure 1", x = "Weight (1000 lbs)", y = "Fuel economy (mpg)", colour = "Gears") p1 + dark_theme_gray() p1 + dark_theme_bw() p1 + dark_theme_linedraw() p1 + dark_theme_light() # quite dark p1 + dark_theme_dark() # quite light p1 + dark_theme_minimal() p1 + dark_theme_classic() p1 + dark_theme_void() # Theme examples with panels p2 <- p1 + facet_grid(vs ~ am) p2 + dark_theme_gray() p2 + dark_theme_bw() p2 + dark_theme_linedraw() p2 + dark_theme_light() # quite dark p2 + dark_theme_dark() # quite light p2 + dark_theme_minimal() p2 + dark_theme_classic() p2 + dark_theme_void() invert_color Invert color(s) Invert a vector of colors, provided the colors are valid hex codes or have valid names (i.e., they belong to base::colors()), and return a vector of inverted colors in hex code. invert_color(color, colour = color) invert_colour(color, colour = color) color colour color(s) to invert alias of color

6 invert_geom_defaults Value Inverted color(s) in hex code Examples invert_color("white") # "black" invert_color("gray20") # "gray80" invert_color("grey80") # "grey20" invert_color(c("#000000", "#333333")) # "#FFFFFF","#CCCCCC" invert_geom_defaults Invert geom defaults for fill and color/colour Invert geom defaults for fill and color/colour invert_geom_defaults(geoms = get_geoms()) geoms List of geoms as ggproto objects Examples library(ggplot2) p <- ggplot(iris, aes(sepal.width, Sepal.Length)) + geom_point() + facet_wrap(~ Species) p + dark_theme_gray() # geom defaults changed p + theme_gray() # oh no! geoms are not visible on light background invert_geom_defaults() # geom defaults changed back p + theme_gray() # back to normal

invert_theme_elements 7 invert_theme_elements Invert theme elements Invert theme elements invert_theme_elements(.theme).theme theme to invert Value Inverted theme

Index dark_mode, 2 dark_theme_bw (ggdarktheme), 3 dark_theme_classic (ggdarktheme), 3 dark_theme_dark (ggdarktheme), 3 dark_theme_gray (ggdarktheme), 3 dark_theme_grey (ggdarktheme), 3 dark_theme_light (ggdarktheme), 3 dark_theme_linedraw (ggdarktheme), 3 dark_theme_minimal (ggdarktheme), 3 dark_theme_test (ggdarktheme), 3 dark_theme_void (ggdarktheme), 3 ggdark, 3 ggdark-package (ggdark), 3 ggdarktheme, 3 invert_color, 5 invert_colour (invert_color), 5 invert_geom_defaults, 6 invert_theme_elements, 7 8