Hacker News new | ask | show | jobs
by peatmoss 4624 days ago
Here's another stab at why ggplot2 is a Good Thing. In the easiest plotting case, there is a function that builds exactly the visualization that you're looking for. This is great as long as you don't need to do anything that deviates from the normal set of barplots, histograms, linegraphs, piecharts (shudder), etc.

But let's say you need something a little different. Maybe you want to add additional dimensions to that dot plot. Maybe you want the dots' size or color to be mapped to different aspects of your data. In a world without ggplot2 (or more generally the grammar of graphics), you're pretty much stuck going to a very primitive drawing system in which you're specifying the virtual path of a pen, or working with basic geometric figures.

The grammar of graphics and ggplot2 occupy a sweet middle ground between being able to simply pick an off-the-shelf visualization, and needing to draw the whole damn works manually. And because the grammar really is consistent, you can also play with different facets of your data and build completely different charts to see which is better at presenting your thesis.

In short, ggplot2 rocks, Hadley/Leland rock, and a port of ggplot2 to Python is nothing but good news for the Python community.