add2ggplot 0.2.0
  • Reference
  • Changelog

add2ggplot

The goal of add2ggplot is to add more theme for your ggplot object.

Installation

You can install the released version of add2ggplot from Github with:

devtools::install_github('JiaxiangBU/add2ggplot')
library(add2ggplot)

Examples

library(add2ggplot)
#> Registered S3 methods overwritten by 'ggplot2':
#>   method         from 
#>   [.quosures     rlang
#>   c.quosures     rlang
#>   print.quosures rlang
plot_logo <- add_logo(
  plot_path = "man/figures/logo.png",
  logo_path = "man/figures/jiaxiang.png",
  logo_position = "bottom right",
  logo_scale = 5)
plot_logo

library(ggrepel)
#> Warning: 程辑包'ggrepel'是用R版本3.6.1 来建造的
#> 载入需要的程辑包:ggplot2
df <- 
mtcars %>%
    tibble::rownames_to_column()
df %>%
    ggplot() +
    aes(mpg, disp, label = rowname) +
    geom_point(color = 'white') +
    # geom_label_repel use fill arg in the segments.
    geom_label_repel(
        data = function(x)
            df %>% head,
        arrow = arrow(length = unit(0.02, "npc")),
        box.padding = 1,
        segment.color = white_one,
        color = white_one,
        label.size = NA,
        fill = red_two,
        aes(face = "bold")
    ) +
    # theme_white()
    theme_grey_and_red() +
    labs(
        title = '使用labs覆盖',
        subtitle = '使用labs覆盖',
        x = '使用labs覆盖',
        y = '使用labs覆盖',
        caption = '备注: 使用labs覆盖'
    )
#> Warning: Ignoring unknown aesthetics: face

Links

  • Browse source code at
    https://​github.com/​JiaxiangBU/​add2ggplot
  • Report a bug at
    https://​github.com/​JiaxiangBU/​add2ggplot/​issues

License

  • Full license
  • MIT + file LICENSE

Developers

  • Jiaxiang Li
    Author, maintainer ORCID
  • Nakagawara Ryo
    Author

Developed by Jiaxiang Li, Nakagawara Ryo.

Site built with pkgdown 1.3.0.