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.
- Install
$ pip install mplpanel
- 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
Release history Release notifications | RSS feed
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.9.tar.gz
(41.7 kB
view details)
Built Distribution
mplpanel-0.1.9-py3-none-any.whl
(39.5 kB
view details)
File details
Details for the file mplpanel-0.1.9.tar.gz
.
File metadata
- Download URL: mplpanel-0.1.9.tar.gz
- Upload date:
- Size: 41.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78ef953e4aae247e6b6affbb43c4d4340d179956b2a495af580ab022bb58baa7 |
|
MD5 | 4fa6ae6cf165645c5401ae7c8ca0447b |
|
BLAKE2b-256 | ced60c2e7b70df5f1c4c47dc3f6d514b93df084ff89fb00712ca8c69f8cbe775 |
File details
Details for the file mplpanel-0.1.9-py3-none-any.whl
.
File metadata
- Download URL: mplpanel-0.1.9-py3-none-any.whl
- Upload date:
- Size: 39.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb4281d76071684dbcb03dc68e25ee644759c01e47049c7a59f9d1a5b69eee0b |
|
MD5 | bf9270ab75bf79df8a97670b20f16fe6 |
|
BLAKE2b-256 | 1ad5f96878bbc06efd00bdabeff2fca25bcb92a2ea5813a963682f78c8adfb42 |