GithubHelp home page GithubHelp logo

limnopalettes's Introduction

LimnoPalettes

Table of Contents

Code and general idea inspired by the “Wes Anderson Palettes” R-Package.

Citing package

citation('LimnoPalettes')
## 
## To cite package 'LimnoPalettes' in publications use:
## 
##   Paul Julian (2020). LimnoPalettes: A Limnology Themed Palette
##   Generator. R package version 0.1.1.
##   https://github.com/SwampThingPaul/LimnoPalettes
## 
## A BibTeX entry for LaTeX users is
## 
##   @Manual{,
##     title = {LimnoPalettes: A Limnology Themed Palette Generator},
##     author = {Paul Julian},
##     year = {2020},
##     note = {R package version 0.1.1},
##     url = {https://github.com/SwampThingPaul/LimnoPalettes},
##   }

Installation

Version 0.1.0 is offically on CRAN

install.packages("LimnoPalettes")

Development version can be installed from this repo.

install.packages("devtools");# if you do not have it installed on your PC
devtools::install_github("SwampThingPaul/LimnoPalettes")

Now Presenting…

Image shared on ABC Midwest and Wheatbelt Facebook Page



Working Examples.

set.seed(1)
dat = data.frame(Group=c(rep("A",10),rep("B",10),rep("C",10),rep("D",10)),
                  var1=rnorm(40),var2=runif(40,1,15),var3=rpois(40,3))

cols = limno_palette("SuperIce",4)
boxplot(var2~Group,dat, col=cols)

cols = limno_palette("IowaSummer",4,"continuous")
cols2 = cols[dat$Group]
plot(var2~var3,dat,pch=21,bg=cols2,cex=2)

cols = limno_palette("PeriFA",4,"continuous")
barplot(aggregate(dat$var3,list(dat$Group),mean)$x,names.arg=unique(dat$Group),ylim=c(0,4),col=cols)

While not a part of this package, for data visualization purposes it would be a good idea to see how these colors are perceived for people with color blindness.

library(colorBlindness)
mat = matrix(1:81, nrow = 9, ncol = 9)

library(ggplot2)
library(reshape2)
cols = limno_palette("IowaSummer")

mat1 = melt(t(mat[9:1, ]))
len = length(cols)-1
mat1$v2 = cut(mat1$value,
              breaks = seq(0,ceiling(81/len)*len, 
                           length.out = len+1))
ht = ggplot(mat1) + 
  geom_tile(aes(x=Var1, y=Var2, fill=v2)) + 
  scale_fill_manual(values=cols) + 
  theme_bw()

# check the plot by CVD simulator
cvdPlot(ht)

# Second Example
cols = limno_palette("Bloom2",10, "continuous")

mat1 = melt(t(mat[9:1, ]))
len = length(cols)-1
mat1$v2 = cut(mat1$value,
              breaks = seq(0,ceiling(81/len)*len, 
                           length.out = len+1))
ht = ggplot(mat1) + 
  geom_tile(aes(x=Var1, y=Var2, fill=v2)) + 
  scale_fill_manual(values=cols) + 
  theme_bw()

# check the plot by CVD simulator
cvdPlot(ht)


limnopalettes's People

Contributors

swampthingpaul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.