3 ms·
Not that long. The trick is to really understand what each clause is doing. It's easy to just find some code on the Web for a graph similar to what you want and
by jhbadger 8y ago
Not that long. The trick is to really understand what each clause is doing. It's easy to just find some code on the Web for a graph similar to what you want and tweak it for your data, and I did that myself in the beginning, but then they will remain "half-magical incantations" as you put it. The thing about ggplot is nothing is there arbitrarily -- it is really describing how the plot is put together.
- dswalter 8y agoThe other thing is that the 'gg' in ggplot2 is the Grammar of Graphics, which describes a high-level grammar for composing visualizations. Having an underlying grammar makes it possible for the syntax to have logical consistency, where once you learn how it works, you can incorporate and generalize simply. (aside, I used to use ggplot2 but I switched to working in python, and I miss ggplot2 so, so much). The syntax being shown here demonstrates an incremental way of layering on the components of the final visualization, which shows the power of the underlying grammar of graphics.
- hprotagonist 8y agoHave you tried plotnine? The api is effectively identical.
- devit 8y agoYou can use R packages from Python and viceversa with rpy2 or reticulate.