Skip to main content

A wx.Panel to use matplotlib plot in wxPython

Project description

mplpanel

mplpanel is a wx.Panel that makes it easy to use matplotlib plot in wxPython application.

  1. Install
$ pip install mplpanel
  1. Usage
# step 1: derive a class from MPLPanel
import matplotlib
matplotlib.use('module://path.to.demo_backend')
class DemoPanel(MPLPanel):
    ...

# step 2: create a backend, e.g,. to provide some helper functions
...
def new_figure_manager(num, *args, **kwargs):
    ...
    from .demo_panel import DemoPanel
    FigureClass = kwargs.pop('FigureClass', Figure)
    thisFig = FigureClass(*args, **kwargs)

    return DemoPanel.AddFigure('Figure %d' % num, num, thisFig)
...

# step 3: create a figure
...
import matplotlib.pyplot as plt

class MainFrame(wx.Frame):
    ...
    def __init__(self, parent, **kwargs):
        ...
        plt.figure()
...

Check the demo for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mplpanel-0.1.5.tar.gz (40.1 kB view details)

Uploaded Source

Built Distribution

mplpanel-0.1.5-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

Details for the file mplpanel-0.1.5.tar.gz.

File metadata

  • Download URL: mplpanel-0.1.5.tar.gz
  • Upload date:
  • Size: 40.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for mplpanel-0.1.5.tar.gz
Algorithm Hash digest
SHA256 e18239a85de397ec212f776bd207a0233ffbd526ee950dc51b5a021d3f53f250
MD5 f2859163b6dc69e0d42c52fa1f18bdf9
BLAKE2b-256 920b2675df104ef33d6d893d92a559456dffb7b953a0bd4d86009a9d38dec5ad

See more details on using hashes here.

File details

Details for the file mplpanel-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: mplpanel-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 37.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for mplpanel-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9b35b419a0cecfc360d6bbb7b8baa01e21bbdb03ef9d7ade704b3bdff117b670
MD5 7f6cfbf05a31a74105ee4cb14d35f362
BLAKE2b-256 4f403448e0f564ed3739592f606f7ca925ffd034f207127e566c04a2b1d9a182

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page