Posts Tagged ‘ graphics ’

Hjust and Vjust

November 16, 2012
By
Hjust and Vjust

So, when you’re setting the position of text in ggplot, you may have to use the hjust and vjust commands. Depending on your demands, and if you don’t understand what they’re doing, they might seem hard to use. I found one script that...

Read more »

Textual Healing Part II

November 15, 2012
By
Textual Healing Part II

Yesterday’s post showed a number of quick coding options for changing text in a basic ggplot. Here’s another two tricks for fine-tuning faceted plots. Again, let’s load our made up data about tooth growth (a real dataset in R, ToothGr...

Read more »

Textual Healing

November 14, 2012
By
Textual Healing

While I know there are several awesome guides for how to make fine-tuning adjustments to plot labels/axes/ticks/text in ggplot, this is still the most common question I get from people new to ggplot: how do I change the size/font/color/position of (som...

Read more »

Can’t a plot catch a break(s)?

November 13, 2012
By
Can’t a plot catch a break(s)?

This post continues with the theme of how to modify plots from within ggplot; today we will specifically looking at custom axis breaks. Plots later in the week will examine the commands to change text in the plot area. The various other shortcomings o...

Read more »

Another look at ideology of the US congress

November 5, 2012
By
Another look at ideology of the US congress

In response to last week's post on the rapidly increasing ideology of the US Republican Party, Mike Lawrence suggested another way of looking at the DW-NOMINATE ideology data. Rather than simply looking at boxplots of the congress scores by party over time, we could fit a smooth curve to get a better sense of the trends over time. Mike...

Read more »

Plotting letters as shapes in ggplot2

November 5, 2012
By
Plotting letters as shapes in ggplot2

This post is a little more esoteric than most, but I found myself needing to solve this problem, so I’m just passing the solution on to you. The plot above shows the distribution of DW-NOMINATE scores for the 18th Congress, with party indicated ...

Read more »

GGtutorial: Day 5 – Gradient Colors and Brewer Palettes

November 2, 2012
By
GGtutorial: Day 5 – Gradient Colors and Brewer Palettes

So, continuing with the short tutorials on how to do relatively simple (but sometimes very frustrating things) in ggplot, today’s post looks at how to use gradient colors and Brewer colors to color either continuous or discrete dependent variab...

Read more »

Watch Obama and Romney criss-cross the US

November 1, 2012
By
Watch Obama and Romney criss-cross the US

The Washington Post has an interactive graphic showing the rate at which the US presidential candidates Barack Obama and Mitt Romney have visited the various states for campaign rallies and fundraisers. Here's how it looks today: You can clearly see the focus on key swing states like Florida and Ohio, as well as non-competitive (but donor-rich) states like California...

Read more »

Tracking Hurricane Sandy with Open Data and R

October 29, 2012
By
Tracking Hurricane Sandy with Open Data and R

Hurricane Sandy is shaping up to be a major, and very dangerous, meteorological event for the US's East coast. Naturally, everyone is looking for the latest information and forecasts. Fortunately, the wealth of public meteorological data available on the open web, combined with real-time on-the-ground updates via social media, means that an ecosystem of on-line apps is now available...

Read more »

Plotting correlation ellipses

October 26, 2012
By
Plotting correlation ellipses

This is an oldie but a goodie. There are a lot of ways to plot multiple bivariate relationships, but this is one of my favorites, courtesy of the R Graph Gallery. https://gist.github.com/819111

Read more »