7 ms·
Ggplot2 – The code powering all those excellent charts is 10 years old
- buffont32 9y agoI don't think I've used a plotting system that even comes close to ggplot2 in terms of intuitiveness. I honestly don't think that R would be held in such high esteem without Wickham's contributions.
- RA_Fisher 9y agoI've pretty much built my career using ggplot2 charting. Grammar of graphics is a really smart idea. Hadley's a master interface designer and decent human-being to boot! :) I really can't express how thankful I am for Hadley's work.
- minimaxir 9y agoggplot2 is the primary reason to use R. Not that Python's modern charting libraries like bokeh/seaborn are bad, but ggplot2 is so robust and customizable while requiring very little LOC. And that doesn't even include external libraries which extended ggplot2, including pairs plots (https://rdrr.io/cran/GGally/man/ggpairs.html https://rdrr.io/cran/GGally/man/ggpairs.html) and automatic interactive charts with plotly (https://plot.ly/ggplot2/ https://plot.ly/ggplot2/) ggplot 2.2.0 added a lot of customization features which make it easier to make a plot look more unique than the stereotypical ggplot2 chart, which I plan to cover in a tutorial soon. (here's an older ggplot2 tutorial of mine which still holds up: http://minimaxir.com/2015/02/ggplot-tutorial/ http://minimaxir.com/2015/02/ggplot-tutorial/ )
- thearn4 9y agoI think the biggest issue with matplotlib is it's straddling of the fence between MATLAB and pythonic syntax throughout the library. It makes it actually pretty hard to predict what the syntax/call signature of a particular method is if you don't use it fairly regularly.
- Godel_unicode 9y agoThis. Matplotlib is easily the most jarring library I use on anything like a regular basis. I really want a requests-for-charting, which has a more pythonic syntax.
- thearn4 9y agoseaborn is actually pretty nice, though not as diverse.
- skierscott 9y agoThere's also altair[1], which also has a grammar of graphics. Most visualizations need one line of code, and it integrates nicely with pandas: Chart(df).mark_point().encode( x='year', y='horsepower', color='brand') [1]:https://altair-viz.github.io https://altair-viz.github.io
- j88439h84 9y agoplotnine is an excellent port of ggplot2 to python. https://plotnine.readthedocs.io/en/latest/index.html https://plotnine.readthedocs.io/en/latest/index.html
- eclecticsceptic 9y agoI've gotten a fair amount of 100 percents, and most recently a job, for which a lot of the credit goes to ggplot. The funniest bit is that the non-technical think it's something extremely complicated when in reality, after somewhat of a learning curve, it's more intuitive than plotting in excel.
- baldeagle 9y agoOne of the main reasons I started with R all those years ago is because updating the monthly charts in excel was (manual | time-consuming | boring), but running printing a new batch of ggplots was a piece of cake. I literally arrived for the graphics and stayed for the rest of R.
- kraemate 9y agoI've always wanted to switch from python's matplotlib to ggplot, but never found sufficient advantages to make the switch. Especially considering that I use python for doing data analysis, and pandas+ipython-notebook can be tightly integrated with matplotlib. Plus I've found it easier to create compact figures necessary for academic publishing with matplotlib. ggplot's defaults create graphs that take up too much space!
- hatmatrix 9y agoNot that this helps with the defaults, but you can use something ggplot2-like in python now: https://plotnine.readthedocs.io/en/stable/ https://plotnine.readthedocs.io/en/stable/
- jtcond13 9y agoTo those of you who hate R, consider investing 1/2 hour to learn the dplyr package. Dplyr is, in my view, Hadley Wickham's real masterpiece and is why I use R for most data analysis nowadays. As for ggplot, the 'grammar of graphics' approach makes it intuitive to get started with but I often run into trouble with both the inheritance hierarchy and with getting graphics 'the last mile' to presentation-quality. My favorite ggplot2 graphic? The London Cycle Hires Map: http://spatial.ly/2012/02/great-maps-ggplot2/ http://spatial.ly/2012/02/great-maps-ggplot2/