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.2.2.tar.gz (42.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mplpanel-0.2.2-py3-none-any.whl (40.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mplpanel-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d93ab5c7ed7a279a691d19a4e6bd137f1e233bfe26398595a32c4d1c64391044
MD5 cb6217d89950c8e61dc13a15257cbb4e
BLAKE2b-256 6270ab3017a91f6738e3f5d97e8a380a7b51b9508e5ad2d04ba4a51a76fbd187

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mplpanel-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 40.4 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.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6537d1e4150f81251c5c6e179052c2c49d7af901c8d4b63193b3da4ab5e44595
MD5 9123217d935c6d664594edcc89b1330b
BLAKE2b-256 a762f2453ea7d173ad9af78fed0dc8aad900672d8b9876ee0c4dce389c595226

See more details on using hashes here.

Supported by

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