nanxstats / ggsci Goto Github PK
View Code? Open in Web Editor NEW🦄 Scientific journal and sci-fi themed color palettes for ggplot2
Home Page: https://nanx.me/ggsci/
License: GNU General Public License v3.0
🦄 Scientific journal and sci-fi themed color palettes for ggplot2
Home Page: https://nanx.me/ggsci/
License: GNU General Public License v3.0
As the BMJ has released it color design (http://technology.bmj.com/living-style-guide/colour.html), is it possible for ggsci to include it in the package? I believe this will be an important update for us medical community of R users!
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?
Prepare for release
cran-comments.md
(optional)urlchecker::url_check()
Submit to CRAN
Wait for CRAN
The arrow-light theme is optimized for accessibility, with arrow-dark for dark backgrounds.
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.
Prepare for release
cran-comments.md
(optional)urlchecker::url_check()
Submit to CRAN
Wait for CRAN
Prepare for release
cran-comments.md
(optional)urlchecker::url_check()
Submit to CRAN
Wait for CRAN
Try different data, larger binwidth.
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!
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)
Document one possible solution when the number of categories in the data is larger than the number of colors in the palette: https://nanx.me/blog/post/ggplot2-color-interpolation/
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:
Prepare for release
cran-comments.md
(optional)urlchecker::url_check()
Submit to CRAN
Wait for CRAN
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.
Replacing the data-raw/
+ R/sysdata.rda
mechanism with code under R/
constructing the color palette data object would make the package development more transparent, reduce unnecessary indirection, and easier to contribute.
To be less tedious.
roxygen2md would be useful.
First 11 colors in: https://github.com/ayu-theme/ayu-colors
Three palettes: light, dark, mirage.
Ordering: check the new Tableau 10 color palette ordering (also used in Observable Plot).
Error in scale_color_cosmic("hallmarks_light") :
could not find function "scale_color_cosmic"
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
Prepare for release
cran-comments.md
(optional)urlchecker::url_check()
Submit to CRAN
Wait for CRAN
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 :
Line 88 in 0b9645a
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), ...)
.
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:
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.
Determine the ggplot2 version live and then branch off, to keep it backward compatible. This seem related: shiny:::is_installed()
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.