[Matplotlib-users] Declarative interface to matplotlib

Hannah story645 at gmail.com
Mon Aug 24 00:13:23 EDT 2020


If you want an out of the box decelerative API, plotnine is a ggplot API
inspired wrapper over Matplotlib. https://plotnine.readthedocs.io/en/stable/

It also kind of stalled out, but their was some work on an mpl-altair
backend to Altair so that you could use the Vegalite grammar and we'd
support that project getting picked up again
https://github.com/matplotlib/mpl-altair

Like Tom said though, it may be cleaner to start w/ your usecase and build
a declarative wrapper around that.

On Sun, Aug 23, 2020, 1:39 PM Ram Rachum <ram at rachum.com> wrote:

> Hi everyone,
>
> I'd like to ask you a general question, as someone who isn't very
> experienced with matplotlib.
>
> I noticed that matplotlib is very imperative, in contrast to declarative.
> For example, I wanted to show an `imshow` plot with a colorbar, so I needed
> to first create the plot, then run `plt.colorbar()`, then show the plot. In
> more complicated plots, you could be doing 10+ actions one after another to
> create a plot.
>
> I would find a declarative interface to be much more elegant, i.e. one
> call to create the plot and lots of keyword arguments, some of them nested,
> to specify all the options. Of course, matplotlib being a very mature
> project, the current interface must be maintained forever. But, do you know
> of any such declarative interface to matplotlib? Either as part of the
> library, or a separate library that uses matplotlib?
>
> If such a thing doesn't exist, what would you think about adding one?
>
>
> Thanks,
> Ram.
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20200824/58927e38/attachment.html>


More information about the Matplotlib-users mailing list