Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Antony Lee
@anntzer
In what sense?
hannah
@story645
Like https://matplotlib.org/api/index_backend_api.html will give me a list of backends, but what I'd want is basically a table 'backend: formats' so like 'agg': png, svg, jpeg, 'imagemagick': mp4, gif, etc.
Antony Lee
@anntzer
why? I mean agg doesn't even do svg for example, it switches to the svg backend behind the scenes to do that (and then switches back to agg after the file is saved)
imagemagick isn't a backend in the matplotlib sense, but an animation writer
so it depends on what you want to do with this table, basically
hannah
@story645
#16226 - if the main page is going to highlight that mpl can export to and embed in all the things, I figure it'd be useful to have a page listing all the options. So basically this is user halfway marketing doc rather than reference.
Antony Lee
@anntzer
but the point is that you don't need to know the backend because the switching is done behind the scenes for you
static formats we support png svg pdf ps jpeg tiff (and really we should be able to support anything that pillow supports, because that's what does the writing for everything but svg/pdf/ps)
animations we support, well, anything that either imagemagick or ffmpeg supports (because we just pass the arg to them), as well as gif and html/js
(gif via pillow)
hannah
@story645
Ok, so maybe I don't want a backend page, but what I want is some where to link to in the docs with the information that you're telling me here which may be the link you posted above
Antony Lee
@anntzer
well, you have the info needed to write that page now :)
hannah
@story645
Yes, thanks! now I gotta figure out where to put it ...
Thomas A Caswell
@tacaswell
@anntzer pushed an update to the zero-length PR
Antony Lee
@anntzer
yup
doc ci is broken due to scipy/scipy#11401, let's see how quickly they resolve it, otherwise we can just fix the url in doc/conf.py in the meantime
Jody Klymak
@jklymak
Where are we keeping MPL "4.0" ideas? The 4.0 roadmap seems more formal.
hannah
@story645
@jklymak shared the dropbox mpl folder with you
it's not terribly formal
Jody Klymak
@jklymak
Yeah, I found my notes at the bottom. Thanks!
Andrzej Novak
@andrzejnovak
Can someone elaborate on the histogram "datastructure" part of that? It would store the original data? What if you have ~10M entries binned along 2/3 axes or more?
Jody Klymak
@jklymak
I can only imagine histogram will only store the bar data
Andrzej Novak
@andrzejnovak
In that case you might want to check out https://github.com/scikit-hep/boost-histogram which is being developed in the HEP community
Jody Klymak
@jklymak
Again, we really only provide hist as a convenience; if folks need performance, they should calculate the histogram as they want and use primitives to draw the results.
Andrzej Novak
@andrzejnovak
Haha yes, hence #15065. Maybe I just misunderstood the scope of what's in the doc :)
Jody Klymak
@jklymak
Well, I guess Thomas doe stay we should hold onto data to allow rebinning, but ...
hannah
@story645
Our latest conversations around this have pointed more towards retaining pointers to the original dataset
And I should likely assimilate my meeting notes back into v4 stuff as it's currently scattered across https://github.com/story645/proposal/tree/master/notes
hannah
@story645
numpy has a new beginners guide and it's great, but what's the simplest way to do the mpl section? https://numpy.org/devdocs/user/absolute_beginners.html#plotting-arrays-with-matplotlib
Antony Lee
@anntzer
their 3d plot syntax is quite outdated...
Eric Wieser
@eric-wieser
I'm sure a PR to improve it would be welcome
kirk86
@kirk86
Hi folks, suppose that I want to plot y = cos(2x^2) where x = Real[-infinity, infinity]. Is there a way to represent that in matplotlib?
hannah
@story645

@eric-wieser was planning on it, just trying to figure out what the best way is. My thinking is:

fig, ax = plt.subplots(subplot_kw={'projection':3d})

is probably too magic, and wondering if

fig = plt.figure()
ax= fig.add_subplot(projection='3D')

is the current recommended way

Antony Lee
@anntzer
would go for the second one
hannah
@story645
thanks!
also, can subplot_kw take a list of dictionaries for each subplot or not so much?
Antony Lee
@anntzer
no and I don't think it would be a really good idea (I mean you may just as well create all of them yourself at that point...)
(not everything has to be a single function call, IMO)
hannah
@story645
@anntzer I get, it's more that at that point you're gonna have to use gridspec directly, but I guess sharex/sharey easyness doesn't make much sense if the projections are all different anyway
Tim Hoffmann
@timhoffm
@kirk86 Matplotlib cannot draw functions directly. You'd have to sample the function on a finite number of points and pass these to Matplotlib. The only "infinite" object Matplotlib supports are straight lines.
Antony Lee
@anntzer
yup
(although matplotlib/matplotlib#15287 may help too, :wink:)
kirk86
@kirk86
@timhoffm thanks, my understanding from your comment is that this is by design, is this technically challenging and I'm only asking because other graphing open-source software have chosen the opposite route of directly drawing functions (i.e. on the whole real axis)?
hannah
@story645
matplotlib broke my numpy docs build...(Could not import extension matplotlib.sphinxext.plot_directive (exception: DLL load failed while importing ft2font: The specified module could not be found.)) - help?
Jody Klymak
@jklymak
@kirk86, Matplotlib is not a symbolic math package, nor is it meant to work directly with one. Its meant to plot NumPy arrays (and children). If you can conceive of representing your function as a numpy array, Matplotlib is your tool. If you can't, then there are other tools out there (Maple, Mathematica?)
hannah
@story645
Also @kirk86 sympy has plotting out to Matplotlib and can maybe do that intermediate under the hood for you
kirk86
@kirk86
Thanks @jklymak and @story645