[Matplotlib-users] Choosing a Backend

Gi,

When I publish or send a Matplotlib script that uses 'gtk3agg' or 'tkagg', can I just be sure that the recipients can use the backend my script does?

···

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

Strictly speaking, no. These backends require optional dependencies to be present. They are not mandatory requirements for a Matplotlib installation.

  • gtk3agg depends on GTK3, which may or may not be present.
  • tkagg depends on Tk. This is part of the standard Python library and thus is present in regular Python installations. However, it is possible to build Python without Tk support. So you cannot be 100% sure about Tk availability either.

See also https://matplotlib.org/users/installing.html#dependencies

No, the available backends are determined by the packages installed by your client. That said, many (but not all) distributions of Python include the tk bindings so if you want the highest probability of your users having the backend of choice, go with tkagg.

That said, depending on what you are doing, you may be able to get away with the GUI agnostic widgets.

Please see https://matplotlib.org/tutorials/introductory/usage.html#what-is-a-backend for more information on backends and https://matplotlib.org/api/widgets_api.html?highlight=widgets#module-matplotlib.widgets for more information on the widgets.

Tom

···

Thomas Caswell
tcaswell@gmail.com

Thanks a lot for your answer.

···

On 3.10.2019 0:25, Thomas Caswell wrote:

No, the available backends are determined by the packages installed by your client. That said, many (but not all) distributions of Python include the tk bindings so if you want the highest probability of your users having the backend of choice, go with tkagg.

That said, depending on what you are doing, you may be able to get away with the GUI agnostic widgets.

Please see https://matplotlib.org/tutorials/introductory/usage.html#what-is-a-backend for more information on backends and https://matplotlib.org/api/widgets_api.html?highlight=widgets#module-matplotlib.widgets for more information on the widgets.

Tom

On Tue, Oct 1, 2019 at 9:44 AM Amit Yaron <amit@phpandmore.net > <mailto:amit@phpandmore.net>> wrote:

    Gi,

    When I publish or send a Matplotlib script that uses 'gtk3agg' or
    'tkagg', can I just be sure that the recipients can use the backend my
    script does?

    _______________________________________________
    Matplotlib-users mailing list
    Matplotlib-users@python.org
    <mailto:Matplotlib-users@python.org>
    https://mail.python.org/mailman/listinfo/matplotlib-users

--
Thomas Caswell
tcaswell@gmail.com <mailto:tcaswell@gmail.com>

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@python.org
https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@python.org
https://mail.python.org/mailman/listinfo/matplotlib-users