1733 search results for "ggplot2"

Improved net stacked distribution graphs via ggplot2 trickery

September 13, 2012
By
Improved net stacked distribution graphs via ggplot2 trickery

Net stacked distribution graphs are a nice way of comparing data on a Likert scale. It strips out the neutral responses and centers the responses around the center of the graph so you can quickly compare agreement and disagreement on different issues. Here we'll build on Jason Becker's work on doing this in ggplot2 -- it requires...

Read more »

ggplot2 0.9.2 has been released!

September 7, 2012
By
ggplot2 0.9.2 has been released!

The main changes in this version are to the theming system. There are also a number of enhancements to the theming system that make it easier to modify themes and we’ve renamed a number of functions to have more informative names. Your existing code should continue to work, although you may receive warnings about functions

Read more »

Add Text Annotations to ggplot2 Faceted Plot (an easier approach)

September 6, 2012
By
Add Text Annotations to ggplot2 Faceted Plot (an easier approach)

I recently posted a blog about adding text to a ggplot2 faceted plot (LINK). I was unhappy with the amount of time it takes to create the text data frame to then label the plot. And then yesterday when the … Continue reading →

Read more »

Style your ggplot2 charts with Themes

September 5, 2012
By
Style your ggplot2 charts with Themes

An update to the ggplot2 "grammar of graphics" package for R is now available on CRAN. This version introduces "Themes" for ggplot2 charts, and makes it possible to define and re-use your own preferences for title fonts and sizes, tick marks, grid color, etc. The system is heirarchically defined, so for example you can choose a font and have...

Read more »

Add Text Annotations to ggplot2 Faceted Plot

August 31, 2012
By
Add Text Annotations to ggplot2 Faceted Plot

In my experience with R learners there are two basic types. The “show me the code and what it does and let me play” type and the “please give me step by step directions” type. I’ve broken the following tutorial … Continue reading →

Read more »

Late to the ggplot2 party

August 29, 2012
By

I have resisted learning the popular R graphics package, ggplot2. I dismissed ggplot2 as primarily useful for exploratory graphics and rationalized my avoidance of ggplot2 by assuming that it would require just as many (or more) lines of code as the R base package to whip the default plots into publication-quality figures. The few times

Read more »

Horizon on ggplot2

August 27, 2012
By
Horizon on ggplot2

SocialDataBlog’s kind reference in post Horizon plots with ggplot (not) motivated me to finish what the post started.  I knew that ggplot2 would be a little more difficult to use for the purpose of a horizon plot, but I felt compelled to provide...

Read more »

Heatmap tables with ggplot2, sort-of

August 27, 2012
By
Heatmap tables with ggplot2, sort-of

I wrote before about heatmap tables as a better way of producing frequency or other tables, with a solution which works nicely in latex. It is possible to do them much more easily in ggplot2, like this library(Hmisc) library(ggplot2) library(reshape) data(HairEyeColor) P=t(HairEyeColor) Pm=melt(P) ggfluctuation(Pm,type="heatmap")+geom_text(aes(label=Pm$value),colour="white")+ opts(axis.text.x=theme_text(size = 15),axis.text.y=theme_text(size = 15)) Note that ggfluctuation will also take

Read more »

ggplot2 Self-deprecation

August 24, 2012
By
ggplot2 Self-deprecation

I've been in China working for a few weeks (where this blog is (oddly) blocked). So, I haven't been able to post much over the summer. To kick things off for the new (academic) year, I thought I might just re-post something good I saw on the Book of Sa...

Read more »

ggplot2 maps with insets

August 22, 2012
By
ggplot2 maps with insets

Here's a quick demo of creating a map with an inset within it using ggplot. The inset is achieved using the gridExtra package. Install libraries, set directory, read file setwd("/Users/ScottMac/Dropbox/CANPOLIN_networks_ms/data") # change ...

Read more »