UPDATE: Changed code to reflect the new
horizontalparameter forgeom_lollipop()
I make a fair share of bar charts throughout the day and really like switching to lollipop charts to mix things up a bit and enhance the visual appeal. They’re easy to do in ggplot2, just use your traditional x & y mapping for geom_point() and then use (you probably want to call this first, actually) geom_segment() mapping the yend aesthetic to 0 and the xend aesthetic to the same thing you used for the x aesthetic. But, that’s alot of typing. Hence, the need for geom_lollipop().
I’ll build this example from one provided by Stephanie Evergreen (that one’s in Excel). It’s not much code:
And, I’ll reiterate Stephanie’s note that the data is fake.
Compare it with it’s sister bar chart:
to see which one you think works better (it really does come down to personal aesthetics choice).
You can find it in the development version of ggalt. The API is not locked in yet so definitely provide feedback in the issues.


No comments yet.