Matplotlib Gallery
matplotlib.org
matplotlib.org
See bokeh (in python) and makie, gadfly, plots, and AlgebraOfGraphics (in julia) for yet more styles of making high level plots. But again, matplotlib targets users needing more control and less statistics (people build stats and other libraries on top of matplotlib though).
Matplotlib is the best I can find for this, despite the sometimes clunky interface. GNUplot is also good, but its easier to have a native python library.
One more thing I'll say that had heavily biased me, I started off with Matlab, and I find that matplotlib is the closest to Matlab plotting, which is a lot of why I like it.
I wouldn’t even consider the two to have different purposes. Let alone “drastically” different. Drastically different api’s? Definitely. But purpose? No way.
Ask on stack overflow, but a 10 second google shows that geom_quiver is a thing.
From my view, the bigger distinction confounding your point is that most people doing non-dataframe oriented engineering work are using Matlab/Python/Julia over R. That would explain the preference for matplotlib, as the api was literally inspired from matlab (an inspiration shared by Julia as well). But I expect it’s more of a convenience thing than anything - why shove a specific part of a different language (tidyverse api for R) into your workflow when the existing solution already works enough?
But R can work just as well, especially given the myriad of tertiary packages designed to transform your data into a “tidy” data frame (eg tidyr).
In any case, if you’re goal is something complicated or bespoke, wrestling with matplotlib is probably the least friendly option available, but ggplot isn’t the best option either. You should just use JavaScript.
It was not a super specific example, it was a standard example of a plot of a field, a type of data that makes no sense as a dataframe. I know that ggplot is great at what it does but why can you not accept that your work and the tools you like using for your work are a small subset of dataviz? I am sure you are great at your corner of it, but the suggestions you are making are just silly for other types of very common dataviz.
And the "inspiration shared by Julia as well" comment is just factually wrong if you are still talking about dataviz libraries. It is *mostly* wrong about the language as a whole.
And using JavaScript is a silly suggestion if you want publication quality static plots. And D3 is a ridiculously bad suggestion for engineering plots that is drastically more difficult to use than matplotlib for bespoke engineering visualizations. The reason matplotlib is the library used for the vast majority of physics and engineering journal papers is not simply inertia, it is the ease with which it customizes engineering plots.
Most of my work takes 30ish lines in matplotlib (the nicer OO interface), is impossible in ggplot, and would take hundreds of lines in D3. But yes, when I work with data frames, of course I would use something like ggplot, not something like matplotlib.
For a ggplot grammar-of-graphics style library in Python, I really like Altair: https://altair-viz.github.io/
It makes, by example, a pretty strong argument for not allowing multiple ways of doing something.
fig, ax = plt.subplots()
then make calls on the Figure and Axes objects.I often use the imperative API as it’s less typing often, and I do a lot of throwaway plotting code. But some functionality only exists in the OO interface. Then it’s an easy trip to gca().my_oo_function() and you recovered the imperative version.
And for most (not all) of the functions, it's an easy read to figure out the OO call.
I claim it's worlds better.
I'm mostly using Altair instead these days since my data is mostly tabular, but Matplotlib still maintains a position in my toolbox and helps me when I need some dirty (or creative) visualization that is tricky with Altair.
And to be honest, I occasionally miss Matplotlib's dense API when I'm fed up with the verbosity Altair has. Yes Altair code is more readable, I agree with the proposition, but being quick and dirty can be lovely sometimes.
I wrote up a blogpost about my findings on how to generate monochrome plots. I haven’t really used matplotlibs since my thesis days, but it’s kinda funny to see what my thoughts back then were on the interface.
I found the OO interface a necessary evil and that you have to mix interfaces to get full control of your plots.
Maybe things have been ironed out in the past 5 years? Reading the comments here it seems like the sentiment is that the OO interface is considered the sane, true interface.
http://olsgaard.dk/monochrome-black-white-plots-in-matplotli...
I haven’t used matplotlib since! (over 2 years)