Matplotlib Data Visualization Guide
Paste the following prompt into your AI chat to install this skill:
Please install @org-02qudk26/cn-matplotlib according to https://skillhub.cn/install/skillhub.md.
About this skill
Problem
Matplotlib is widely used for Python visualization, but real plotting work often runs into implicit plt.plot state, messy multi-axis layouts, overlapping labels, inconsistent color maps, and poor export settings. This skill addresses those practical engineering issues and helps turn quick exploratory charts into maintainable, export-ready visualization code.
Core Capabilities and Workflow
- Interface choice: Prefer the object-oriented API such as
fig, ax = plt.subplots()to avoid pyplot statefulness; usepltshortcuts only for quick exploration. - Object model: Organize code around
Figure,Axes,Artist, andAxisso multi-panel plots, axes, legends, and annotations remain easier to maintain. - Plot coverage: Supports common statistical and scientific charts, including line plots, scatter plots, bar charts, histograms, heatmaps, contour plots, and box plots.
- Styling and customization: Covers colors, style sheets,
rcParams, annotations, and color map selection, reducing ad-hoc per-chart parameter tuning. - Export and performance: Provides practical
savefigparameters such asdpi,bbox_inches='tight', andtransparent=True, and suggestsrasterized=Trueor downsampling for large datasets. - 3D and interactivity: Includes guidance for 3D visualization, animation, Jupyter workflows, and GUI integration.
Boundaries and Caveats
This skill is best for writing and reviewing Python data-visualization code, not for choosing business chart designs. If the project has strict GUI backend, font, publishing, or rendering constraints, verify the setup in the target environment. For complex dashboards or real-time visualization, Matplotlib can serve as a low-level plotting component, but it may not replace more specialized visualization frameworks.
Use Cases
- When preparing research paper figures, create multi-panel trend plots with error annotations and export 300 DPI PDF files.
- When writing data analysis reports, build styled scatter and box plots with custom colorbars using the object-oriented API.
- During Jupyter data exploration, generate interactive heatmaps and animations to inspect time-series anomalies.
- When maintaining Python plotting scripts, diagnose overlapping labels, pyplot state issues, and unwanted PNG backgrounds.
Best For
- Research engineers writing Python experiment code who need publication-ready model metric charts
- Data analysts maintaining reporting scripts who need consistent legends, colors, and axis styling
- Algorithm engineers evaluating models in Jupyter who need interactive heatmaps and animations
- Backend engineers taking over legacy plotting code who need to debug pyplot state and export issues
Related Skills
Analyzes smart customer-service chat logs with semantic clustering to generate word clouds, Top K frequent questions, and personalized guess-you-ask recommendations.
Maps natural-language Reddit requests to KeyAPI REST workflows, validates endpoint contracts against official docs, and executes search, detail, comment, ranking, and report tasks.
Schedules fetching from NEP and custom academic sites, filters and ranks papers by keywords, generates Chinese summaries, and pushes Feishu cards with local download archiving.
Browser-based CSV/TXT visualizer with multi-Y-axis curves, smoothing, and PNG/JSON/CSV export.