Enhance your Matplotlib visualizations with richer visual context and sophisticated effects.
mpl-visual-context
is a Python library that expands Matplotlib's capabilities, allowing you to easily add contextual elements, apply complex visual effects, and create more compelling and informative plots. Whether you need to highlight data, guide the viewer's eye, or simply make your charts more aesthetically pleasing, mpl-visual-context
provides the tools you need.
HLSModify
, StrokeColorFromFillColor
).StrokeOnly
, FillOnly
, Smooth
).Glow
, CmapGlow
).AlphaGradient
, Gradient
).ImageEffect
).pip install mpl_visual_contextQuick Start: Adding a Glow Effect
Here's a simple example of how to apply a glow effect to a line plot:
import matplotlib.pyplot as plt from mpl_visual_context.patheffects import Glow from matplotlib.patheffects import Normal # For the original line # Sample data x = [0, 1, 2, 3, 4] y = [0, 2, 1, 3, 1] fig, ax = plt.subplots(figsize=(6, 4)) line, = ax.plot(x, y, linewidth=2, label="My Data") # Apply a glow effect # The Normal() effect ensures the original line is also drawn line.set_path_effects([Glow(alpha_max=0.8, n_glow_lines=10), Normal()]) ax.set_title("Plot with Glow Effect") ax.legend() plt.show()
Our documentation provides comprehensive information on all features and how to use them:
The documentation is actively being developed and improved.
We welcome contributions! Whether it's bug reports, feature suggestions, documentation improvements, or code contributions, please check out our Contribution Guidelines (assuming this will be the link, adjust if different, or link to a CONTRIBUTING.md
file if it exists).
mpl-visual-context
is licensed under the MIT License. See the LICENSE
file for more details. (Assuming MIT and a LICENSE file exists, adjust as necessary).
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4