Custom-toolbar-button
Using this package, you can add custom widgets(with icon image and callback function) in matplotlib's toolbar.
Example
- Forward and backward widgets are by default, on click chart shift 5 step forward and backward resp.
import os
# import custom_toolbar_button before matplotlib pyplot
from custom_toolbar_button import tool
import matplotlib.pyplot as plt
# ----- Your code ---- #
- You can give n number of widgets list using TOOLITEMS global variable.
TOOLITEMS is list of tuple[Widget name, Tooltip text, Icon png complete path with name, Callback function].
import os
# import custom_toolbar_button before matplotlib pyplot
from custom_toolbar_button import tool
icons = tool.Icons(os.path.dirname(__file__))
"""
Callback function should have same structure as mention below (function callback_func)
cls_instance is NavigationToolbar instance
"""
def callback_func(cls_instance):
"""
cls_instance: NavigationToolbar2TK or NavigationToolbar2QT
"""
def wrapper():
print('Custom tool button example.')
return wrapper
tool.TOOLITEMS = [(
"Python Icon", # Widget name
"Tooltip Python icon", # Tooltip text
icons.icon_path("pyicon.png"), # Icon png complete path with name
callback_func # Callback function
)]
import matplotlib.pyplot as plt
# ----- Your code ---- #
Metadata
Release files for custom-toolbar-button 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| custom_toolbar_button-0.1.1.tar.gz | 9.7 kB | Without provenance | Details for custom_toolbar_button-0.1.1.tar.gz |
Security for custom-toolbar-button 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.