Visualizations Gone Wild

Who said art had to be intentional?

I don’t spend as much time making art as I would like, so it’s always a pleasant surprise when bad code inadvertently helps me fix that. This is “Desert Mountains, Sunken Sun” and is brought to you by ggplot2.

DesertMountainsandSun

Usingstat_binhex()you can create colorful heat map density plots with hexagons representing a collection of observations with adjacent values. There is a problem with stretch, such that hexagons will becomes exceptionally large if few observations with comparable values exist.

What’s the quick solution? Toggle the number of bins over which the data is represented using stat_binhex(bins = n), where the default n is 30, and consider applying a log or log10 transform (e.g., trans = "log10" in your scale_fill_XXXX command) which controls the values that correspond to the legend’s tick marks. You’ll likely have to toy around with a few combinations before finding the most visually informative values.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s