background preloader

Color Palettes

Facebook Twitter

iWantHue. The yarrr package (0.0.8) is (finally!) on CRAN. Great news R pirates!

The yarrr package (0.0.8) is (finally!) on CRAN

The yarrr package, which contains the pirateplot, has now been updated to version 0.0.8 and is up on CRAN (after hiding in plain sight on GitHub). Let’s install the latest version (0.0.8) and go over some of the updates: The most important function in the yarrr package is pirateplot(). What the heck is a pirateplot? A pirateplot is a modern way of visualising the relationship between a categorical independent variable, and a continuous dependent variable. For a full guide to the package, check out the package guide at CRAN here. Up to 3 IVs You can now include up to three independent variables in your pirateplot.

GitHub - Bart6114/artyfarty: ggplot2 theme presets. The Pirate Plot (2.0) – The RDI plotting choice of R pirates. Package update!

The Pirate Plot (2.0) – The RDI plotting choice of R pirates

Yesterday I updated the yarrr package and pirateplot() function with additional functionality. To see the updates, check out my latest post here Now on to the original post… Plain vanilla barplots are as uninformative (and ugly) as they are popular. And boy, are they popular. Instead of barplots, we should be using RDI plots, where RDI stands for Raw (data), Description and Inference. Today, the R community has access to a new RDI plot — the pirate plot. Introduction to ggthemes. Library("ggplot2") library("ggthemes") p <- ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point() + ggtitle("Cars") p2 <- ggplot(mtcars, aes(x = wt, y = mpg, colour = factor(gear))) + geom_point() + ggtitle("Cars") p3 <- p2 + facet_wrap(~ am) Tufte theme and geoms Minimal theme and geoms based on plots in The Visual Display of Quantitative Information. p + geom_rangeframe() + theme_tufte() + scale_x_continuous(breaks = extended_range_breaks()(mtcars$wt)) + scale_y_continuous(breaks = extended_range_breaks()(mtcars$mpg)) The function geom_tufteboxplot creates several variants of Tufte’s minimal-ink boxplots.

For a boxplot with a point indicating the median, a gap indicating the interquartile range, and lines for whiskers: Color Thief. The ggthemr package – Theme and colour your ggplot figures. Theming ggplot figure output The default colour themes in ggplot2 are beautiful.

The ggthemr package – Theme and colour your ggplot figures

Your figures look great, the colours match, and you have the characteristic “R” look and feel. The author of ggplot2, Hadley Wickham, has done a fantastic job. Psychology, decision making, statistics, R…and pirates. Quantitate: Color Quantization in R. In this post, we'll look at a simple method to identify segments of an image based on RGB color values.

quantitate: Color Quantization in R

The segmentation technique we'll consider is called color quantization. Not surprisingly, this topic lends itself naturally to visualization and R makes it easy to render some really cool graphics for the color quantization problem. The code presented in detail below is packaged concisely in this github gist: By sourcing this script in R, all the required images will be fetched and some demo visualizations will be rendered. Digital color images can be represented using the RGB color model. The goal of image segmentation, is to take a digital image and partition it into simpler regions. The Elements of Choosing Colors for Great Data Visualization in R. Color is crucial for elegant data visualization.

The Elements of Choosing Colors for Great Data Visualization in R

In our previous article we describe the list of color palettes available in R. In this current article we define the basics for using the power of color and, we describe an R package and an online tool for generating beautiful color schemes. (Image from Nancy Duarte, slide:ology) Color extraction with R. Given all the attention the internet has given to the colors of this dress, I thought it would be interesting to look at the capabilities for extracting colors in R.

Color extraction with R

R has a number of packages for importing images in various file formats, including PNG, JPG, TIFF, and BMP. Cttobin/ggthemr · GitHub. Zoom + Pan. Woobe/rPlotter. Wes Anderson color palette. I'm a big fan of Wes Anderson's movies.

Wes Anderson color palette

I love the quirky characters and stories, the distinctive cinematography, and the unique visual style. Now you can bring some of that style to your own R charts, by making use of these Wes Anderson inspired palettes. Just choose your favourite Wes Anderson film or short: Karthik/wesanderson. Towards (Yet) Another R Colour Palette Generator. Step One: Quentin Tarantino. Why?

Towards (Yet) Another R Colour Palette Generator. Step One: Quentin Tarantino.

I love colours, I love using colours even more. Unfortunately, I have to admit that I don't understand colours well enough to use them properly. It is the same frustration that I had about one year ago when I first realised that I couldn't plot anything better than the defaults in Excel and Matlab! It was for that very reason, I decided to find a solution and eventually learned R. Still learning it today. What's wrong with my previous attempts to use colours?