Git Product home page Git Product logo

ggsci's Introduction

ggsci

R-CMD-check CRAN Version Downloads from the RStudio CRAN mirror

ggsci offers a collection of ggplot2 color palettes inspired by scientific journals, data visualization libraries, science fiction movies, and TV shows.

Installation

You can install ggsci from CRAN:

install.packages("ggsci")

Or try the development version on GitHub:

remotes::install_github("nanxstats/ggsci")

Browse the vignette (or open with vignette("ggsci") in R) for a quick-start guide.

Gallery

NPG

AAAS

NEJM

Lancet

JAMA

JCO

UCSCGB

D3

LocusZoom

IGV

COSMIC

UChicago

Star Trek

Tron Legacy

Futurama

Rick and Morty

The Simpsons

Flat UI

Frontiers

GSEA

Material Design

Contribute

To contribute to this project, please take a look at the Contributing Guidelines first. Please note that the ggsci project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

ggsci's People

Contributors

clarajegousse avatar danchaltiel avatar jhrcook avatar nanxstats avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ggsci's Issues

Release ggsci 3.0.0

Prepare for release

  • Check current CRAN check results
  • Check licensing of included files
  • Review pkgdown reference index for, e.g., missing topics
  • Bump version
  • Update cran-comments.md (optional)
  • Update NEWS.md
  • Review pkgdown website
  • urlchecker::url_check()
  • Check with local machine
  • Check with GitHub Actions
  • Check with win-builder

Submit to CRAN

  • Draft GitHub release
  • Submit to CRAN via web form
  • Approve emails

Wait for CRAN

  • Accepted 🎉

Update problem

Hi, I noticed your ggsci package have been updated to v2.7, however when I install it is till 2.4, and can't be updated. Do you have any solutions? Thanks in advance!

Using `scale_colour_xxx` throws a warning with recent ggplot2

Hi,

Thank you for this wonderful package.

Using scale_colour_xxx() throws a warning with recent ggplot2:

Warning message:
The `scale_name` argument of `discrete_scale()` is deprecated as of ggplot2 3.5.0.

It seems to pertain to this line :

discrete_scale("fill", "lancet", pal_lancet(palette, alpha), ...)

From what I understood from tidyverse/ggplot2#1312, the deprecation means that the name should be simply removed: discrete_scale("fill", palette=pal_lancet(palette, alpha), ...).

Backward compatibility with ggplot2 < 3.5.0

Using ggsci 3.0.2 (the version that removes scale_name argument) with ggplot2 < 3.5.0, it will complain:

Error in `discrete_scale()`:
! argument "scale_name" is missing, with no default
Backtrace:
 1. ggsci::scale_color_npg()
 2. ggplot2::discrete_scale(...)
 3. ggplot2::ggproto(...)
 4. rlang::list2(...)
Execution halted

There are two options:

  1. We could declare the minimum version ggplot2 (>= 3.5.0) in DESCRIPTION, As suggested by #25 (comment), although that would require users to upgrade ggplot2.

  2. Determine the ggplot2 version live and then branch off, to keep it backward compatible. This seem related: shiny:::is_installed().

color number

Dear authuors:

when I use ggsci, the scale_color_npg() only provied 10 colors,in fact ,I need 15 colors,how can I fix it?

image

Documentation: add the hint that you can use global options

Hi Nan,

Thanks for this great package!

I just discovered that you can use global options to set the scale for all your plots:

options(ggplot2.discrete.colour=ggsci::scale_colour_lancet)
options(ggplot2.discrete.fill=ggsci::scale_fill_lancet)

I think this might be worth showing in the doc and in the pkgdown website.

Release ggsci 3.0.2

Prepare for release

  • Check current CRAN check results
  • Check licensing of included files
  • Review pkgdown reference index for, e.g., missing topics
  • Bump version
  • Update cran-comments.md (optional)
  • Update NEWS.md
  • Review pkgdown website
  • urlchecker::url_check()
  • revdepcheck
  • Check with local machine
  • Check with GitHub Actions
  • Check with win-builder

Submit to CRAN

  • Draft GitHub release
  • Submit to CRAN via web form
  • Approve emails

Wait for CRAN

  • Accepted 🎉

Release ggsci 3.0.1

Prepare for release

  • Check current CRAN check results
  • Check licensing of included files
  • Review pkgdown reference index for, e.g., missing topics
  • Bump version
  • Update cran-comments.md (optional)
  • Update NEWS.md
  • Review pkgdown website
  • urlchecker::url_check()
  • Check with local machine
  • Check with GitHub Actions
  • Check with win-builder

Submit to CRAN

  • Draft GitHub release
  • Submit to CRAN via web form
  • Approve emails

Wait for CRAN

  • Accepted 🎉

Manually re-order palette

This is a feature request.
Is it possible to manually re-order the color palettes?
For example, I would like the colors of scale_color_tron to be red, yellow, blue, green..
Great package, BTW.

Reverse dependency check notes

R -q
remotes::install_github("r-lib/revdepcheck")
# This is not necessarily needed
options(repos = "https://cloud.r-project.org/")

# If the default BioC mirror doesn't work, select the mirror in Germany
utils::chooseBioCmirror()

revdepcheck::revdep_check(num_workers = 32)

Can I create my own color pattern?

Hi, thank you for your great tool! It is very useful for us to draw a beautiful picture. And I have a question about can I create my own color pattern? For example, if I want use some colors from nejm and some colors from, and combine these colors into a scale_color_xx pattern. Then, I can use scale_color_XX to draw my picture?

Release ggsci 3.0.3

Prepare for release

  • Check current CRAN check results
  • Check licensing of included files
  • Review pkgdown reference index for, e.g., missing topics
  • Bump version
  • Update cran-comments.md (optional)
  • Update NEWS.md
  • Review pkgdown website
  • urlchecker::url_check()
  • Check with local machine
  • Check with GitHub Actions
  • Check with win-builder
  • revdepcheck

Submit to CRAN

  • Draft GitHub release
  • Submit to CRAN via web form
  • Approve emails

Wait for CRAN

  • Accepted 🎉

Other Hallmarks of Cancer colors

So it turns out that COSMIC used different shades of the same colors for the Hallmarks of Cancer than in Weinberg's "Hallmarks of cancer: the next generation" paper. I would like to add Weinberg's (they are lighter shades and thus easier to use in plots), but am not sure where. Do you think this is a worthwhile addition and, if so, where would you like me to add them (in the COSMIC palette or a new palette)?

Thanks,
Josh Cook

Create code example that scales

R has a check note when installed package size is > 5Mb:

  installed size is  5.1Mb
  sub-directories of 1Mb or more:
    doc    2.7Mb
    help   2.3Mb

The doc here is the vignette with the figures embedded. The help here contains the output figures from README.Rmd. Since they have roughly the same content, the limit is ~2.4Mb max for each. We should prioritize the README file figure legibility as it's also served on GitHub repo besides CRAN and the pkgdown site.

For a PNG-based solution, ragg::ragg_png() generates the minimal size PNG files. We have to keep fig.width = 10.6667 and fig.height = 3.3334. While we are reaching the lower legibility limit when keeping dpi = 72. Set fig.retina = 1.2 for vignette and set fig.retina = 2 for README. This gives us 2.3 Mb + 2.6 Mb = 4.9 Mb.

For a SVG-based solution, svglite produces the minimal size SVG files. They are super legible (vector-based) and can dramatically reduce the figure sizes. However, the current code example contains too many data points and generates ~100Kb figures per palette.

Conclusion:

  1. Switch to svglite device for both README and vignette.
  2. Create a revised code example that generates much smaller SVG outputs.

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.