This package, with the aim of accelerating and facilitating the use of some design patterns, offers abstract classes.
Project description
Matplotlib Dashboard Package
This package creates a simple user interface for creating subfigures when working with matplotlib.
import matplotlib.pyplot as plt
plt.figure(figsize=(10,10))
from matplotlib_dashboard import MatplotlibDashboard
dashboard = MatplotlibDashboard([
['top' ,'top' ,'top' ,'top' ],
['left','left', None ,'right'],
['left','left','down','right'],
], as3D=['left'], wspace=0.5, hspace=0.5)
import numpy as np
dashboard['top'].plot(np.random.rand(200), color='red')
dashboard['top'].set_ylabel('y')
dashboard['top'].set_xlabel('x')
dashboard['top'].set_title('top plot')
dashboard['right'].bar(['A','B','C'], [10,35,17], color='blue')
dashboard['right'].set_ylabel('freq')
dashboard['right'].set_xlabel('label')
dashboard['right'].set_title('right bar')
from PIL import Image
dashboard['down'].imshow(Image.open('./test1.jpeg'))
dashboard['down'].get_xaxis().set_ticks([])
dashboard['down'].get_yaxis().set_ticks([])
dashboard['down'].set_title('down image')
z = ((5-np.arange(100)%10)**3).reshape(10,10)
x, y = np.meshgrid(np.arange(z.shape[0]), np.arange(z.shape[1]))
dashboard['left'].plot_surface(x, y, z, color='green')
dashboard['left'].set_ylabel('x')
dashboard['left'].set_xlabel('y')
dashboard['left'].set_zlabel('z')
dashboard['left'].set_title('left surface')
plt.show()
Customization
- Pass the map of subfigures you want when instantiation a dashboard. Write the map as a list of lists or a 2D-array.
- Get the subfigure you want using get-item syntax. The name is what you defined in the map.
- Use the
None
keyword to access empty part of the map. - Use
as3D
argument to determine which subfigures are 3D. - Any customization on
matplotlib.pyplot
also applies to this dashboard. For example, useplt.figure(figsize=(x,y))
to change the size of the dashboard figure. - This module is based on
matplotlib.gridspec
. So you can use the parameters that are configurable in the initialization of agridspec
with the same functionality in the initialization of this module. For example, set thewspace
andhspace
parameters to change the horizontal or vertical spacing between subfigures.
Installation
Package is avalable on PyPI.
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
Built Distribution
File details
Details for the file matplotlib-dashboard-0.0.1.tar.gz
.
File metadata
- Download URL: matplotlib-dashboard-0.0.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9dc64e846ee3019222785bafd65dd5a8a40e798c5463e440b4651ff81c3cddd |
|
MD5 | 687ba34ee0e6b488d86f4e220be3a20d |
|
BLAKE2b-256 | d7638735690e7ed59d1611842e0acd9a02bd37f7d52869dfd09a3dae74aad45a |
File details
Details for the file matplotlib_dashboard-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: matplotlib_dashboard-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74ec84860e286df4038bebe1b7dde3a1e7ceee13edc7ccbb9137cf4beff5e540 |
|
MD5 | edd16033eca9b63c60cbc489d6e32fce |
|
BLAKE2b-256 | ba35f20c6095b31736f4b05e0c5af2b5ceacd11c99144f90c81ee3b92b04567c |