How to use your favorite fonts in R charts →
Winston Chang has a guest post on the Revolution Analytics blog about embedding fonts into PDFs using the extrafont package which, not surprisingly, works very well with ggplot2.
ggbio (package, publication) is an extension and specialization of ggplot designed for visualizing genomics annotations and high-throughput data A frequent requirement for plots of genomic data is indicating the relationship of measurements on different scales. For example, the x-axis of the lower plots in this image is the linear chromosome position, but the upper plot shows the expression...
Defining a new transformation for ggplot2/scales -...
In my previous blog post, I explored what was needed to create a new transformation for the scales package and gave an example of a mathematical transformation. In this post, I want to show an additional example related to the other mentioned use case (mapping a continuous like variable with specific structure and formatting) and extend the example into creating new scales functions which...
Mapping Quantitative Values to Color
Nils Gehlenborg & Bang Wong discuss “Mapping Quantitative Values to Color” in this month’s issue of Nature Methods. The article is paywalled, but I was able to access the figure without a subscription. They map out a systematic approach to color choice, starting with considering the salient regions of your data range and any values with special meaning (i.e. zero, 32 degrees...
Computing your heart rate with a webcam, ruby, R... →
Using ggplot2 to examine the digital divide... →
Violence In America Visualized via ggplot2 →
ggplot syntax reminders
There are ggplot features that I use often enough to know they exist but not often enough to remember in detail. Lately I’ve started moving examples of these features to the menu bar. I use the Mac utility called ClipMenu, which I first started using as a clipboard manager, but now I’m using the snippets feature for this. This screen shot shows two ggplot snippets. The first one...
Exploring Oracle's revenue with ggplot2 →
Exploring the Tour de France with R and ggplot2 →
Soda vs. Pop with Twitter →
Defining a new transformation for ggplot2/scales
Inspired by writing an answer to this question on StackOverflow, I decided to write up a more detailed description of creating a new transformation using the scales package (and also to make sure that I understood all the details about how to really do it). Background To start with, it helps to understand the philosophy behind the scales package. From the description of the scales package: ...
Dot density measurements
Jim Perkins is a scientific illustrator who recently contributed a guest post about the various meanings of DPI (dots-per-inch) at Symbiartic, a Scientific American blog about “The art of science and the science of art.” He also has a couple previous posts about calibrating monitors.
Annotating histograms to indicate the location of... →
Simulating conditions of legislative violence
Christopher Gandrud uses ggplot to illustrate his analysis of violence in national legislative chambers (e.g. Turkey, above). After gathering a data set of incidents of legislative violence, he applied logistic regression for rare events to identify the most important variables and the extent of their importance. He then predicted the probability of violence in a range of conditions with a...
Assessing the Price of Solid State Harddrives
Over a staff meeting at work, the topic of price of solid state hard drives came up (what are they, is it non linear with size, etc.). I decided to sample 120 solid state hard drives from newegg.com and recorded their size (in GB) and price (in USD) as well as their class (SATA II or SATA III). Note that the sampling was semi-random, in that I had no particular agenda, but did not go to great...
Data Visualization in the Neurosciences:... →
Summary: In publications, presentations, and popular media, scientific results are predominantly communicated through graphs. But are these figures clear and honest or misleading? We examine current practices in data visualization and discuss improvements, advocating design choices which reveal data rather than hide it.
A 14 page cheatsheet for ggplot2 →
Written by Ramon Saccilotto, shared by @m4xl1n
This dynamic representation of the popularity of names over the years is a favorite. It’s not new, but I still find new things to appreciate, like names that used to apply to both sexes and now only one (Ellie), or vice versa (Harley). It seems like there are more very popular male names than very popular female names; I can hardly guess what underlies that.
Some interesting ggplot2 tutorials for the social... →
How to order bars in bar graph (Stack Overflow... →
Choosing colour palettes. Part II: Educated...
There are many resources on the use of colours in R, several packages, and a number of schemes already implemented in ggplot2. In the previous part, we saw how ggplot2 selects a default colour palette according to the type of variable, discrete or continuous. There are further options, illustrated below: Choosing colours for a graphic is often some kind of a compromise. One one hand, you want...
Managing the deluge of DNA data
The explosion in DNA sequencing capacity has shifted the experimental bottleneck from sequencing to analyzing and interpreting sequences. The bioconductor package cummeRbund uses ggplot as part of its tool set for organizing, exploring and visualizing sequencing data related to gene expression. Congrats to the authors on their recent publication (paywall).
Posts about ggplot2 on r-bloggers
You can also get your fix of ggplot2 on r-bloggers (where this blog is also syndicated): http://www.r-bloggers.com/search/ggplot
Visualizing car brand choices in ggplot2 →
Choosing colour palettes. Part I: Introduction
In this series of three posts, we’ll look at colours in R graphics produced with ggplot2: what are the available choices of colour schemes, and how to choose a colour palette most suitable for a particular graphic? In kindergarten, choosing a colour was easy, palettes were limited to a few classics. As cool kids grow older and use R, the spectrum expands to present us with overwhelming...
Automating repetitive plot elements
The syntax of ggplot2 emphasizes constructing plots by adding components, or layers, using +. Possibly one of the most useful, but least remarked upon, consequences of this syntax is that it allows for an incredible degree of flexibility in saving and reusing components of plots. Here are two very simple examples that come up frequently for me. I frequently make line plots where the x axis is...
Sunlight foundation analyses complexity of... →
Adding watermarks to plots
A question was raised today on the mailing list: Is there an easy way to add a watermark to a ggplot? There are several options, depending on the type of watermark and the required level of control over the output, add a text label using annotate (the original idea of the poster) add a custom grob (graphical object from the Grid package), using annotation_custom In either case, the...
Bias in Federal Reserve Inflation Forecasts →
Christopher Gandrud uses ggplot2 to visualize potential partisan bias in US Federal Reserve inflation forecasts as a PhD student at the London School of Economics.
ggplot2 presentation at Victoria University of...
Next week I’ll present a glimpse of R and ggplot2 graphics at VUW. This is a MESA seminar on ‘Data analysis and plotting with free and open source tools’ where we’ll present spreadsheet alternatives based on gnuplot, Python, and R. Presentation
Neat demo real of d3 (js & svg powered interactive graphics in the browser). Hopefully there will be ggplot2 integration one day!
The Foreign Language of 'Mad Men' →
ggplot2 in the Atlantic