matplotlib
Create publication-ready plots with matplotlib
Also available from: davila7
Matplotlib provides complete control over every visual element for creating publication-quality figures. Master both pyplot and object-oriented interfaces to build any chart type from simple line plots to complex multi-panel scientific visualizations.
Download the skill ZIP
Upload in Claude
Go to Settings → Capabilities → Skills → Upload skill
Toggle on and start using
Test it
Using "matplotlib". Create a scatter plot showing the relationship between height and weight with proper labels
Expected outcome:
- Generated scatter plot with height (cm) on x-axis and weight (kg) on y-axis
- Added linear trend line showing correlation coefficient
- Included axis labels: Height (cm) and Weight (kg)
- Set title: Height vs Weight Relationship
- Applied colorblind-friendly color scheme
- Saved as high-resolution PNG (300 DPI) for publication
Using "matplotlib". Create a 2x2 multi-panel figure showing sales trends, product distribution, regional comparison, and monthly growth
Expected outcome:
- Created figure with 4 subplots in 2x2 layout
- Top-left: Line plot showing sales trends over 12 months
- Top-right: Pie chart of product category distribution
- Bottom-left: Bar chart comparing regional performance
- Bottom-right: Area chart showing monthly growth rates
- Applied consistent styling across all panels with unified legend
Security Audit
SafeAll 552 static findings are FALSE POSITIVES. The 'Ruby/shell backtick execution' (494 locations) are Python code examples in markdown documentation. 'Weak cryptographic algorithm' flags are metadata hashes and configuration access. 'C2 keywords' is 'claude' model identifier in metadata. 'System reconnaissance' is matplotlib querying available styles. 'Certificate/key files' is style configuration file writing. No malicious code execution, credential exfiltration, or network abuse detected.
Risk Factors
⚙️ External commands (5)
🌐 Network access (1)
📁 Filesystem access (1)
Quality Score
What You Can Build
Create publication-ready figures
Generate high-quality plots for research papers with proper labeling, error bars, and multiple subplot layouts
Explore and visualize datasets
Quickly plot data distributions, correlations, and trends to understand patterns before formal analysis
Learn data visualization fundamentals
Master plotting concepts through hands-on examples covering all major chart types and customization techniques
Try These Prompts
Create a line plot of my data with dates on x-axis and values on y-axis. Add proper labels and grid.
Create a 2x2 subplot layout showing histogram, scatter plot, box plot, and bar chart of my dataset
Apply publication-quality styling to my plot: increase font sizes, remove top/right spines, use appropriate DPI
Add arrows and text annotations to mark the maximum value and important events on my time series plot
Best Practices
- Always use the object-oriented interface (fig, ax = plt.subplots()) for better control and maintainability
- Set figure size and DPI appropriately for your output medium (300 DPI for print, 150 DPI for web)
- Use constrained_layout=True or tight_layout() to prevent overlapping elements
Avoid
- Avoid using the pyplot state machine interface for complex figures - it leads to confusing code
- Do not use rainbow/jet colormaps - they are not perceptually uniform and can misrepresent data
- Never save figures without bbox_inches='tight' - it leaves unnecessary whitespace
Frequently Asked Questions
What is the difference between pyplot and object-oriented interfaces?
How do I save high-quality figures for publications?
Why are my subplot labels overlapping?
Which colormap should I use?
How do I create a colorblind-friendly plot?
Can I use matplotlib in Jupyter notebooks?
Developer Details
Author
K-Dense-AILicense
https://github.com/matplotlib/matplotlib/tree/main/LICENSE
Repository
https://github.com/K-Dense-AI/claude-scientific-skills/tree/main/scientific-skills/matplotlibRef
main
File structure