Giter Club home page Giter Club logo

mpl-gui's Introduction

PyPi Conda Downloads NUMFocus

Discourse help forum Gitter GitHub issues Contributing

GitHub actions status Azure pipelines status AppVeyor status Codecov status EffVer Versioning

Matplotlib logotype

Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python.

Check out our home page for more information.

image

Matplotlib produces publication-quality figures in a variety of hardcopy formats and interactive environments across platforms. Matplotlib can be used in Python scripts, Python/IPython shells, web application servers, and various graphical user interface toolkits.

Install

See the install documentation, which is generated from /doc/users/installing/index.rst

Contribute

You've discovered a bug or something else you want to change — excellent!

You've worked out a way to fix it — even better!

You want to tell us about it — best of all!

Start at the contributing guide!

Contact

Discourse is the discussion forum for general questions and discussions and our recommended starting point.

Our active mailing lists (which are mirrored on Discourse) are:

Gitter is for coordinating development and asking questions directly related to contributing to matplotlib.

Citing Matplotlib

If Matplotlib contributes to a project that leads to publication, please acknowledge this by citing Matplotlib.

A ready-made citation entry is available.

mpl-gui's People

Contributors

greglucas avatar jklymak avatar lgtm-migrator avatar qulogic avatar tacaswell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mpl-gui's Issues

What to do about manager number ?

At creation time each manager is assigned a number (which is either 1 or 1 higher than the currently existing number) and there is some API in pyplot to get the list of current numbers etc. Currently in mpl-gui, this number is set in the promote_figure method and is a process-globally incremented number. I think the options are:

  1. no change, the number of the manager is a vestige of an old API, it is harmless, but 🤷🏻 . Using an always incrementing counter means that we never have currently-live duplicates (because we never have duplicates)
  2. allow promote_figure to take an optional num as input (but probably still increment the counter for cases where it is not given. We can then have the registries re-implement the pyplot scheme. One wrinkle in this is if you ask for the number before all of the figures are promoted, they do not have numbers yet so either we need to pre-assign them numbers (not great, where to store that), drop them on the floor (not great, the list of figures can depend on if you called show?!), or promote but not show (probably the least-bad).
  3. make num required to promote
  4. add the notion of num to creating Figure objects.

Having written this out i'm going to go with option 2. It is not too hard to let registries maintain the old pyplot behavior and I would rather have all registries behave the same than have a custom one just for getting as close to pyplot compatibility as possible.

FigureRegistry as a module?

Currently we instantiate figure registry instances, which maybe is OK:

import mpl_gui as mg
fr = mg.FigureRegistry()
fig, ax = fr.subplots()

but is it possible to provide a default registry with an import?

import mpl_gui.registry as fr
fig, ax = fr.subplots()

That would be more analogous to what we have now, but the cost would be a global lying around.

Differences with show() between backends

I was just testing out the examples from the docs and figured I would put some quick findings here while running on a Mac.

  • Documentation: Change subplot_module to subplot_mosaic in a couple of places in the code samples
  • qt5agg: mg.show() does not exit after closing both figures, the event loop keeps running
  • macosx: mg.show() closing one figure closes all of the figures, as if the closeWindow gets sent to every figure, not just the one clicked.
  • tkagg: In the second fr.show() call in the examples I get this error: _tkinter.TclError: can't invoke "wm" command: application has been destroyed (macosx seems to get through this and the qt5agg I don't think ever even gets here due to the event loop not quiting after the first show() as mentioned above)

rename `mpl_gui.show`

The name is a good one, but mpl_gui.show (which requires a list of Figures to be passed) has a very different API than FigureRegistry.show (and mpl_gui.registry.show) and matplotlib.pyplot.show (to which you may not pass a list of Figures).

The current leading contender is display

osx backend alias

Everything seems to work well with macosx from a standard Python terminal, but I decided to switch over to ipython and noticed that there is a mismatch in the alias names for the event loops (ipython seems to look for "osx" instead of "macosx").

import mpl_gui as mg
from matplotlib.figure import Figure

fig1 = Figure(label='A Label!')

fig2 = Figure()

mg.show([fig1, fig2])
UnknownBackend: No event loop integration for 'macosx'. Supported event loops are: qt, qt4, qt5, qt6, gtk, gtk2, gtk3, gtk4, tk, wx, pyglet, glut, osx, asyncio

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.