[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AFG9NBH1MMH4XWQY4A7JF0":3,"skill-same:01M6AFG9NBH1MMH4XWQY4A7JF0":116},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":41,"linkOnly":42,"markdownContent":43,"markdownBody":44,"frontMatter":45,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":49,"repositoryHtmlUrl":50,"repositoryHomepageUrl":51,"ownerHtmlUrl":52,"ownerBlogUrl":53,"ownerDescription":54,"updatedAt":55,"install":56,"resources":69},"01M6AFG9NBH1MMH4XWQY4A7JF0","matplotlib",null,"Foundational plotting library. Create line plots, scatter, bar, histograms, heatmaps, 3D, subplots, export PNG\u002FPDF\u002FSVG, for scientific visualization and publication figures.","davila7\u002Fclaude-code-templates","davila7","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6216945?v=4","01M6ADEWWFPS191NFM0Y1EX1JH","Daniel Avila","01M6ADJHGM78PHQRD3XZTFDVKK",33481,"MIT","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fmatplotlib\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",[5,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"plotting","Heatmaps","Publication","bar","for","figures","scientific","line","SVG","PDF","export","png","3D","scientific visualization","library","visualization","create","2026-11-10 10:12:30",false,"---\nname: matplotlib\ndescription: \"Foundational plotting library. Create line plots, scatter, bar, histograms, heatmaps, 3D, subplots, export PNG\u002FPDF\u002FSVG, for scientific visualization and publication figures.\"\n---\n\n# Matplotlib\n\n## Overview\n\nMatplotlib is Python's foundational visualization library for creating static, animated, and interactive plots. This skill provides guidance on using matplotlib effectively, covering both the pyplot interface (MATLAB-style) and the object-oriented API (Figure\u002FAxes), along with best practices for creating publication-quality visualizations.\n\n## When to Use This Skill\n\nThis skill should be used when:\n- Creating any type of plot or chart (line, scatter, bar, histogram, heatmap, contour, etc.)\n- Generating scientific or statistical visualizations\n- Customizing plot appearance (colors, styles, labels, legends)\n- Creating multi-panel figures with subplots\n- Exporting visualizations to various formats (PNG, PDF, SVG, etc.)\n- Building interactive plots or animations\n- Working with 3D visualizations\n- Integrating plots into Jupyter notebooks or GUI applications\n\n## Core Concepts\n\n### The Matplotlib Hierarchy\n\nMatplotlib uses a hierarchical structure of objects:\n\n1. **Figure** - The top-level container for all plot elements\n2. **Axes** - The actual plotting area where data is displayed (one Figure can contain multiple Axes)\n3. **Artist** - Everything visible on the figure (lines, text, ticks, etc.)\n4. **Axis** - The number line objects (x-axis, y-axis) that handle ticks and labels\n\n### Two Interfaces\n\n**1. pyplot Interface (Implicit, MATLAB-style)**\n```python\nimport matplotlib.pyplot as plt\n\nplt.plot([1, 2, 3, 4])\nplt.ylabel('some numbers')\nplt.show()\n```\n- Convenient for quick, simple plots\n- Maintains state automatically\n- Good for interactive work and simple scripts\n\n**2. Object-Oriented Interface (Explicit)**\n```python\nimport matplotlib.pyplot as plt\n\nfig, ax = plt.subplots()\nax.plot([1, 2, 3, 4])\nax.set_ylabel('some numbers')\nplt.show()\n```\n- **Recommended for most use cases**\n- More explicit control over figure and axes\n- Better for complex figures with multiple subplots\n- Easier to maintain and debug\n\n## Common Workflows\n\n### 1. Basic Plot Creation\n\n**Single plot workflow:**\n```python\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Create figure and axes (OO interface - RECOMMENDED)\nfig, ax = plt.subplots(figsize=(10, 6))\n\n# Generate and plot data\nx = np.linspace(0, 2*np.pi, 100)\nax.plot(x, np.sin(x), label='sin(x)')\nax.plot(x, np.cos(x), label='cos(x)')\n\n# Customize\nax.set_xlabel('x')\nax.set_ylabel('y')\nax.set_title('Trigonometric Functions')\nax.legend()\nax.grid(True, alpha=0.3)\n\n# Save and\u002For display\nplt.savefig('plot.png', dpi=300, bbox_inches='tight')\nplt.show()\n```\n\n### 2. Multiple Subplots\n\n**Creating subplot layouts:**\n```python\n# Method 1: Regular grid\nfig, axes = plt.subplots(2, 2, figsize=(12, 10))\naxes[0, 0].plot(x, y1)\naxes[0, 1].scatter(x, y2)\naxes[1, 0].bar(categories, values)\naxes[1, 1].hist(data, bins=30)\n\n# Method 2: Mosaic layout (more flexible)\nfig, axes = plt.subplot_mosaic([['left', 'right_top'],\n                                 ['left', 'right_bottom']],\n                                figsize=(10, 8))\naxes['left'].plot(x, y)\naxes['right_top'].scatter(x, y)\naxes['right_bottom'].hist(data)\n\n# Method 3: GridSpec (maximum control)\nfrom matplotlib.gridspec import GridSpec\nfig = plt.figure(figsize=(12, 8))\ngs = GridSpec(3, 3, figure=fig)\nax1 = fig.add_subplot(gs[0, :])  # Top row, all columns\nax2 = fig.add_subplot(gs[1:, 0])  # Bottom two rows, first column\nax3 = fig.add_subplot(gs[1:, 1:])  # Bottom two rows, last two columns\n```\n\n### 3. Plot Types and Use Cases\n\n**Line plots** - Time series, continuous data, trends\n```python\nax.plot(x, y, linewidth=2, linestyle='--', marker='o', color='blue')\n```\n\n**Scatter plots** - Relationships between variables, correlations\n```python\nax.scatter(x, y, s=sizes, c=colors, alpha=0.6, cmap='viridis')\n```\n\n**Bar charts** - Categorical comparisons\n```python\nax.bar(categories, values, color='steelblue', edgecolor='black')\n# For horizontal bars:\nax.barh(categories, values)\n```\n\n**Histograms** - Distributions\n```python\nax.hist(data, bins=30, edgecolor='black', alpha=0.7)\n```\n\n**Heatmaps** - Matrix data, correlations\n```python\nim = ax.imshow(matrix, cmap='coolwarm', aspect='auto')\nplt.colorbar(im, ax=ax)\n```\n\n**Contour plots** - 3D data on 2D plane\n```python\ncontour = ax.contour(X, Y, Z, levels=10)\nax.clabel(contour, inline=True, fontsize=8)\n```\n\n**Box plots** - Statistical distributions\n```python\nax.boxplot([data1, data2, data3], labels=['A', 'B', 'C'])\n```\n\n**Violin plots** - Distribution densities\n```python\nax.violinplot([data1, data2, data3], positions=[1, 2, 3])\n```\n\nFor comprehensive plot type examples and variations, refer to `references\u002Fplot_types.md`.\n\n### 4. Styling and Customization\n\n**Color specification methods:**\n- Named colors: `'red'`, `'blue'`, `'steelblue'`\n- Hex codes: `'#FF5733'`\n- RGB tuples: `(0.1, 0.2, 0.3)`\n- Colormaps: `cmap='viridis'`, `cmap='plasma'`, `cmap='coolwarm'`\n\n**Using style sheets:**\n```python\nplt.style.use('seaborn-v0_8-darkgrid')  # Apply predefined style\n# Available styles: 'ggplot', 'bmh', 'fivethirtyeight', etc.\nprint(plt.style.available)  # List all available styles\n```\n\n**Customizing with rcParams:**\n```python\nplt.rcParams['font.size'] = 12\nplt.rcParams['axes.labelsize'] = 14\nplt.rcParams['axes.titlesize'] = 16\nplt.rcParams['xtick.labelsize'] = 10\nplt.rcParams['ytick.labelsize'] = 10\nplt.rcParams['legend.fontsize'] = 12\nplt.rcParams['figure.titlesize'] = 18\n```\n\n**Text and annotations:**\n```python\nax.text(x, y, 'annotation', fontsize=12, ha='center')\nax.annotate('important point', xy=(x, y), xytext=(x+1, y+1),\n            arrowprops=dict(arrowstyle='->', color='red'))\n```\n\nFor detailed styling options and colormap guidelines, see `references\u002Fstyling_guide.md`.\n\n### 5. Saving Figures\n\n**Export to various formats:**\n```python\n# High-resolution PNG for presentations\u002Fpapers\nplt.savefig('figure.png', dpi=300, bbox_inches='tight', facecolor='white')\n\n# Vector format for publications (scalable)\nplt.savefig('figure.pdf', bbox_inches='tight')\nplt.savefig('figure.svg', bbox_inches='tight')\n\n# Transparent background\nplt.savefig('figure.png', dpi=300, bbox_inches='tight', transparent=True)\n```\n\n**Important parameters:**\n- `dpi`: Resolution (300 for publications, 150 for web, 72 for screen)\n- `bbox_inches='tight'`: Removes excess whitespace\n- `facecolor='white'`: Ensures white background (useful for transparent themes)\n- `transparent=True`: Transparent background\n\n### 6. Working with 3D Plots\n\n```python\nfrom mpl_toolkits.mplot3d import Axes3D\n\nfig = plt.figure(figsize=(10, 8))\nax = fig.add_subplot(111, projection='3d')\n\n# Surface plot\nax.plot_surface(X, Y, Z, cmap='viridis')\n\n# 3D scatter\nax.scatter(x, y, z, c=colors, marker='o')\n\n# 3D line plot\nax.plot(x, y, z, linewidth=2)\n\n# Labels\nax.set_xlabel('X Label')\nax.set_ylabel('Y Label')\nax.set_zlabel('Z Label')\n```\n\n## Best Practices\n\n### 1. Interface Selection\n- **Use the object-oriented interface** (fig, ax = plt.subplots()) for production code\n- Reserve pyplot interface for quick interactive exploration only\n- Always create figures explicitly rather than relying on implicit state\n\n### 2. Figure Size and DPI\n- Set figsize at creation: `fig, ax = plt.subplots(figsize=(10, 6))`\n- Use appropriate DPI for output medium:\n  - Screen\u002Fnotebook: 72-100 dpi\n  - Web: 150 dpi\n  - Print\u002Fpublications: 300 dpi\n\n### 3. Layout Management\n- Use `constrained_layout=True` or `tight_layout()` to prevent overlapping elements\n- `fig, ax = plt.subplots(constrained_layout=True)` is recommended for automatic spacing\n\n### 4. Colormap Selection\n- **Sequential** (viridis, plasma, inferno): Ordered data with consistent progression\n- **Diverging** (coolwarm, RdBu): Data with meaningful center point (e.g., zero)\n- **Qualitative** (tab10, Set3): Categorical\u002Fnominal data\n- Avoid rainbow colormaps (jet) - they are not perceptually uniform\n\n### 5. Accessibility\n- Use colorblind-friendly colormaps (viridis, cividis)\n- Add patterns\u002Fhatching for bar charts in addition to colors\n- Ensure sufficient contrast between elements\n- Include descriptive labels and legends\n\n### 6. Performance\n- For large datasets, use `rasterized=True` in plot calls to reduce file size\n- Use appropriate data reduction before plotting (e.g., downsample dense time series)\n- For animations, use blitting for better performance\n\n### 7. Code Organization\n```python\n# Good practice: Clear structure\ndef create_analysis_plot(data, title):\n    \"\"\"Create standardized analysis plot.\"\"\"\n    fig, ax = plt.subplots(figsize=(10, 6), constrained_layout=True)\n\n    # Plot data\n    ax.plot(data['x'], data['y'], linewidth=2)\n\n    # Customize\n    ax.set_xlabel('X Axis Label', fontsize=12)\n    ax.set_ylabel('Y Axis Label', fontsize=12)\n    ax.set_title(title, fontsize=14, fontweight='bold')\n    ax.grid(True, alpha=0.3)\n\n    return fig, ax\n\n# Use the function\nfig, ax = create_analysis_plot(my_data, 'My Analysis')\nplt.savefig('analysis.png', dpi=300, bbox_inches='tight')\n```\n\n## Quick Reference Scripts\n\nThis skill includes helper scripts in the `scripts\u002F` directory:\n\n### `plot_template.py`\nTemplate script demonstrating various plot types with best practices. Use this as a starting point for creating new visualizations.\n\n**Usage:**\n```bash\npython scripts\u002Fplot_template.py\n```\n\n### `style_configurator.py`\nInteractive utility to configure matplotlib style preferences and generate custom style sheets.\n\n**Usage:**\n```bash\npython scripts\u002Fstyle_configurator.py\n```\n\n## Detailed References\n\nFor comprehensive information, consult the reference documents:\n\n- **`references\u002Fplot_types.md`** - Complete catalog of plot types with code examples and use cases\n- **`references\u002Fstyling_guide.md`** - Detailed styling options, colormaps, and customization\n- **`references\u002Fapi_reference.md`** - Core classes and methods reference\n- **`references\u002Fcommon_issues.md`** - Troubleshooting guide for common problems\n\n## Integration with Other Tools\n\nMatplotlib integrates well with:\n- **NumPy\u002FPandas** - Direct plotting from arrays and DataFrames\n- **Seaborn** - High-level statistical visualizations built on matplotlib\n- **Jupyter** - Interactive plotting with `%matplotlib inline` or `%matplotlib widget`\n- **GUI frameworks** - Embedding in Tkinter, Qt, wxPython applications\n\n## Common Gotchas\n\n1. **Overlapping elements**: Use `constrained_layout=True` or `tight_layout()`\n2. **State confusion**: Use OO interface to avoid pyplot state machine issues\n3. **Memory issues with many figures**: Close figures explicitly with `plt.close(fig)`\n4. **Font warnings**: Install fonts or suppress warnings with `plt.rcParams['font.sans-serif']`\n5. **DPI confusion**: Remember that figsize is in inches, not pixels: `pixels = dpi * inches`\n\n## Additional Resources\n\n- Official documentation: https:\u002F\u002Fmatplotlib.org\u002F\n- Gallery: https:\u002F\u002Fmatplotlib.org\u002Fstable\u002Fgallery\u002Findex.html\n- Cheatsheets: https:\u002F\u002Fmatplotlib.org\u002Fcheatsheets\u002F\n- Tutorials: https:\u002F\u002Fmatplotlib.org\u002Fstable\u002Ftutorials\u002Findex.html\n","# Matplotlib\n\n## Overview\n\nMatplotlib is Python's foundational visualization library for creating static, animated, and interactive plots. This skill provides guidance on using matplotlib effectively, covering both the pyplot interface (MATLAB-style) and the object-oriented API (Figure\u002FAxes), along with best practices for creating publication-quality visualizations.\n\n## When to Use This Skill\n\nThis skill should be used when:\n- Creating any type of plot or chart (line, scatter, bar, histogram, heatmap, contour, etc.)\n- Generating scientific or statistical visualizations\n- Customizing plot appearance (colors, styles, labels, legends)\n- Creating multi-panel figures with subplots\n- Exporting visualizations to various formats (PNG, PDF, SVG, etc.)\n- Building interactive plots or animations\n- Working with 3D visualizations\n- Integrating plots into Jupyter notebooks or GUI applications\n\n## Core Concepts\n\n### The Matplotlib Hierarchy\n\nMatplotlib uses a hierarchical structure of objects:\n\n1. **Figure** - The top-level container for all plot elements\n2. **Axes** - The actual plotting area where data is displayed (one Figure can contain multiple Axes)\n3. **Artist** - Everything visible on the figure (lines, text, ticks, etc.)\n4. **Axis** - The number line objects (x-axis, y-axis) that handle ticks and labels\n\n### Two Interfaces\n\n**1. pyplot Interface (Implicit, MATLAB-style)**\n```python\nimport matplotlib.pyplot as plt\n\nplt.plot([1, 2, 3, 4])\nplt.ylabel('some numbers')\nplt.show()\n```\n- Convenient for quick, simple plots\n- Maintains state automatically\n- Good for interactive work and simple scripts\n\n**2. Object-Oriented Interface (Explicit)**\n```python\nimport matplotlib.pyplot as plt\n\nfig, ax = plt.subplots()\nax.plot([1, 2, 3, 4])\nax.set_ylabel('some numbers')\nplt.show()\n```\n- **Recommended for most use cases**\n- More explicit control over figure and axes\n- Better for complex figures with multiple subplots\n- Easier to maintain and debug\n\n## Common Workflows\n\n### 1. Basic Plot Creation\n\n**Single plot workflow:**\n```python\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Create figure and axes (OO interface - RECOMMENDED)\nfig, ax = plt.subplots(figsize=(10, 6))\n\n# Generate and plot data\nx = np.linspace(0, 2*np.pi, 100)\nax.plot(x, np.sin(x), label='sin(x)')\nax.plot(x, np.cos(x), label='cos(x)')\n\n# Customize\nax.set_xlabel('x')\nax.set_ylabel('y')\nax.set_title('Trigonometric Functions')\nax.legend()\nax.grid(True, alpha=0.3)\n\n# Save and\u002For display\nplt.savefig('plot.png', dpi=300, bbox_inches='tight')\nplt.show()\n```\n\n### 2. Multiple Subplots\n\n**Creating subplot layouts:**\n```python\n# Method 1: Regular grid\nfig, axes = plt.subplots(2, 2, figsize=(12, 10))\naxes[0, 0].plot(x, y1)\naxes[0, 1].scatter(x, y2)\naxes[1, 0].bar(categories, values)\naxes[1, 1].hist(data, bins=30)\n\n# Method 2: Mosaic layout (more flexible)\nfig, axes = plt.subplot_mosaic([['left', 'right_top'],\n                                 ['left', 'right_bottom']],\n                                figsize=(10, 8))\naxes['left'].plot(x, y)\naxes['right_top'].scatter(x, y)\naxes['right_bottom'].hist(data)\n\n# Method 3: GridSpec (maximum control)\nfrom matplotlib.gridspec import GridSpec\nfig = plt.figure(figsize=(12, 8))\ngs = GridSpec(3, 3, figure=fig)\nax1 = fig.add_subplot(gs[0, :])  # Top row, all columns\nax2 = fig.add_subplot(gs[1:, 0])  # Bottom two rows, first column\nax3 = fig.add_subplot(gs[1:, 1:])  # Bottom two rows, last two columns\n```\n\n### 3. Plot Types and Use Cases\n\n**Line plots** - Time series, continuous data, trends\n```python\nax.plot(x, y, linewidth=2, linestyle='--', marker='o', color='blue')\n```\n\n**Scatter plots** - Relationships between variables, correlations\n```python\nax.scatter(x, y, s=sizes, c=colors, alpha=0.6, cmap='viridis')\n```\n\n**Bar charts** - Categorical comparisons\n```python\nax.bar(categories, values, color='steelblue', edgecolor='black')\n# For horizontal bars:\nax.barh(categories, values)\n```\n\n**Histograms** - Distributions\n```python\nax.hist(data, bins=30, edgecolor='black', alpha=0.7)\n```\n\n**Heatmaps** - Matrix data, correlations\n```python\nim = ax.imshow(matrix, cmap='coolwarm', aspect='auto')\nplt.colorbar(im, ax=ax)\n```\n\n**Contour plots** - 3D data on 2D plane\n```python\ncontour = ax.contour(X, Y, Z, levels=10)\nax.clabel(contour, inline=True, fontsize=8)\n```\n\n**Box plots** - Statistical distributions\n```python\nax.boxplot([data1, data2, data3], labels=['A', 'B', 'C'])\n```\n\n**Violin plots** - Distribution densities\n```python\nax.violinplot([data1, data2, data3], positions=[1, 2, 3])\n```\n\nFor comprehensive plot type examples and variations, refer to `references\u002Fplot_types.md`.\n\n### 4. Styling and Customization\n\n**Color specification methods:**\n- Named colors: `'red'`, `'blue'`, `'steelblue'`\n- Hex codes: `'#FF5733'`\n- RGB tuples: `(0.1, 0.2, 0.3)`\n- Colormaps: `cmap='viridis'`, `cmap='plasma'`, `cmap='coolwarm'`\n\n**Using style sheets:**\n```python\nplt.style.use('seaborn-v0_8-darkgrid')  # Apply predefined style\n# Available styles: 'ggplot', 'bmh', 'fivethirtyeight', etc.\nprint(plt.style.available)  # List all available styles\n```\n\n**Customizing with rcParams:**\n```python\nplt.rcParams['font.size'] = 12\nplt.rcParams['axes.labelsize'] = 14\nplt.rcParams['axes.titlesize'] = 16\nplt.rcParams['xtick.labelsize'] = 10\nplt.rcParams['ytick.labelsize'] = 10\nplt.rcParams['legend.fontsize'] = 12\nplt.rcParams['figure.titlesize'] = 18\n```\n\n**Text and annotations:**\n```python\nax.text(x, y, 'annotation', fontsize=12, ha='center')\nax.annotate('important point', xy=(x, y), xytext=(x+1, y+1),\n            arrowprops=dict(arrowstyle='->', color='red'))\n```\n\nFor detailed styling options and colormap guidelines, see `references\u002Fstyling_guide.md`.\n\n### 5. Saving Figures\n\n**Export to various formats:**\n```python\n# High-resolution PNG for presentations\u002Fpapers\nplt.savefig('figure.png', dpi=300, bbox_inches='tight', facecolor='white')\n\n# Vector format for publications (scalable)\nplt.savefig('figure.pdf', bbox_inches='tight')\nplt.savefig('figure.svg', bbox_inches='tight')\n\n# Transparent background\nplt.savefig('figure.png', dpi=300, bbox_inches='tight', transparent=True)\n```\n\n**Important parameters:**\n- `dpi`: Resolution (300 for publications, 150 for web, 72 for screen)\n- `bbox_inches='tight'`: Removes excess whitespace\n- `facecolor='white'`: Ensures white background (useful for transparent themes)\n- `transparent=True`: Transparent background\n\n### 6. Working with 3D Plots\n\n```python\nfrom mpl_toolkits.mplot3d import Axes3D\n\nfig = plt.figure(figsize=(10, 8))\nax = fig.add_subplot(111, projection='3d')\n\n# Surface plot\nax.plot_surface(X, Y, Z, cmap='viridis')\n\n# 3D scatter\nax.scatter(x, y, z, c=colors, marker='o')\n\n# 3D line plot\nax.plot(x, y, z, linewidth=2)\n\n# Labels\nax.set_xlabel('X Label')\nax.set_ylabel('Y Label')\nax.set_zlabel('Z Label')\n```\n\n## Best Practices\n\n### 1. Interface Selection\n- **Use the object-oriented interface** (fig, ax = plt.subplots()) for production code\n- Reserve pyplot interface for quick interactive exploration only\n- Always create figures explicitly rather than relying on implicit state\n\n### 2. Figure Size and DPI\n- Set figsize at creation: `fig, ax = plt.subplots(figsize=(10, 6))`\n- Use appropriate DPI for output medium:\n  - Screen\u002Fnotebook: 72-100 dpi\n  - Web: 150 dpi\n  - Print\u002Fpublications: 300 dpi\n\n### 3. Layout Management\n- Use `constrained_layout=True` or `tight_layout()` to prevent overlapping elements\n- `fig, ax = plt.subplots(constrained_layout=True)` is recommended for automatic spacing\n\n### 4. Colormap Selection\n- **Sequential** (viridis, plasma, inferno): Ordered data with consistent progression\n- **Diverging** (coolwarm, RdBu): Data with meaningful center point (e.g., zero)\n- **Qualitative** (tab10, Set3): Categorical\u002Fnominal data\n- Avoid rainbow colormaps (jet) - they are not perceptually uniform\n\n### 5. Accessibility\n- Use colorblind-friendly colormaps (viridis, cividis)\n- Add patterns\u002Fhatching for bar charts in addition to colors\n- Ensure sufficient contrast between elements\n- Include descriptive labels and legends\n\n### 6. Performance\n- For large datasets, use `rasterized=True` in plot calls to reduce file size\n- Use appropriate data reduction before plotting (e.g., downsample dense time series)\n- For animations, use blitting for better performance\n\n### 7. Code Organization\n```python\n# Good practice: Clear structure\ndef create_analysis_plot(data, title):\n    \"\"\"Create standardized analysis plot.\"\"\"\n    fig, ax = plt.subplots(figsize=(10, 6), constrained_layout=True)\n\n    # Plot data\n    ax.plot(data['x'], data['y'], linewidth=2)\n\n    # Customize\n    ax.set_xlabel('X Axis Label', fontsize=12)\n    ax.set_ylabel('Y Axis Label', fontsize=12)\n    ax.set_title(title, fontsize=14, fontweight='bold')\n    ax.grid(True, alpha=0.3)\n\n    return fig, ax\n\n# Use the function\nfig, ax = create_analysis_plot(my_data, 'My Analysis')\nplt.savefig('analysis.png', dpi=300, bbox_inches='tight')\n```\n\n## Quick Reference Scripts\n\nThis skill includes helper scripts in the `scripts\u002F` directory:\n\n### `plot_template.py`\nTemplate script demonstrating various plot types with best practices. Use this as a starting point for creating new visualizations.\n\n**Usage:**\n```bash\npython scripts\u002Fplot_template.py\n```\n\n### `style_configurator.py`\nInteractive utility to configure matplotlib style preferences and generate custom style sheets.\n\n**Usage:**\n```bash\npython scripts\u002Fstyle_configurator.py\n```\n\n## Detailed References\n\nFor comprehensive information, consult the reference documents:\n\n- **`references\u002Fplot_types.md`** - Complete catalog of plot types with code examples and use cases\n- **`references\u002Fstyling_guide.md`** - Detailed styling options, colormaps, and customization\n- **`references\u002Fapi_reference.md`** - Core classes and methods reference\n- **`references\u002Fcommon_issues.md`** - Troubleshooting guide for common problems\n\n## Integration with Other Tools\n\nMatplotlib integrates well with:\n- **NumPy\u002FPandas** - Direct plotting from arrays and DataFrames\n- **Seaborn** - High-level statistical visualizations built on matplotlib\n- **Jupyter** - Interactive plotting with `%matplotlib inline` or `%matplotlib widget`\n- **GUI frameworks** - Embedding in Tkinter, Qt, wxPython applications\n\n## Common Gotchas\n\n1. **Overlapping elements**: Use `constrained_layout=True` or `tight_layout()`\n2. **State confusion**: Use OO interface to avoid pyplot state machine issues\n3. **Memory issues with many figures**: Close figures explicitly with `plt.close(fig)`\n4. **Font warnings**: Install fonts or suppress warnings with `plt.rcParams['font.sans-serif']`\n5. **DPI confusion**: Remember that figsize is in inches, not pixels: `pixels = dpi * inches`\n\n## Additional Resources\n\n- Official documentation: https:\u002F\u002Fmatplotlib.org\u002F\n- Gallery: https:\u002F\u002Fmatplotlib.org\u002Fstable\u002Fgallery\u002Findex.html\n- Cheatsheets: https:\u002F\u002Fmatplotlib.org\u002Fcheatsheets\u002F\n- Tutorials: https:\u002F\u002Fmatplotlib.org\u002Fstable\u002Ftutorials\u002Findex.html\n",{"name":5,"description":7},"main","2b749c82b5d11fac39d9a6e021ce3f5b8a541bd1","cli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fmatplotlib",3931,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates","https:\u002F\u002Faitmpl.com","https:\u002F\u002Fgithub.com\u002Fdavila7","https:\u002F\u002Fdanielavila.me","Building AI dev tools with LLMs","2026-11-14 06:14:46",{"source":8,"skillName":5,"commands":57,"prompt":67,"zipAvailable":68},[58,61,64],{"tool":59,"command":60},"npx","npx skills add davila7\u002Fclaude-code-templates --skill matplotlib",{"tool":62,"command":63},"bunx","bunx skills add davila7\u002Fclaude-code-templates --skill matplotlib",{"tool":65,"command":66},"pnpm","pnpm dlx skills add davila7\u002Fclaude-code-templates --skill matplotlib","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fmatplotlib\u002FSKILL.md",true,[70,76,82,86,90,94,98,102,106,112],{"path":71,"resourceType":72,"resourceTypeDesc":73,"sizeBytes":74,"sourceHtmlUrl":75},"LICENSE.txt","LICENSE","许可证",147,"https:\u002F\u002Fgithub.com\u002Fnoirelab\u002Flinux-setup\u002Fblob\u002Fmain\u002Fconfigs\u002Fcommon\u002Fclaude\u002Fskills\u002Fseo-content-brief\u002FLICENSE.txt",{"path":77,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":80,"sourceHtmlUrl":81},"references\u002Fapi_reference.md","REFERENCE","参考文档",11233,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fmatplotlib\u002Freferences\u002Fapi_reference.md",{"path":83,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Fcommon_issues.md",12836,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fmatplotlib\u002Freferences\u002Fcommon_issues.md",{"path":87,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Fexcluded-domains.md",2881,"https:\u002F\u002Fgithub.com\u002Fnoirelab\u002Flinux-setup\u002Fblob\u002Fmain\u002Fconfigs\u002Fcommon\u002Fclaude\u002Fskills\u002Fseo-content-brief\u002Freferences\u002Fexcluded-domains.md",{"path":91,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fkeyword-density.md",3134,"https:\u002F\u002Fgithub.com\u002Fnoirelab\u002Flinux-setup\u002Fblob\u002Fmain\u002Fconfigs\u002Fcommon\u002Fclaude\u002Fskills\u002Fseo-content-brief\u002Freferences\u002Fkeyword-density.md",{"path":95,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Fpage-type-templates.md",7174,"https:\u002F\u002Fgithub.com\u002Fnoirelab\u002Flinux-setup\u002Fblob\u002Fmain\u002Fconfigs\u002Fcommon\u002Fclaude\u002Fskills\u002Fseo-content-brief\u002Freferences\u002Fpage-type-templates.md",{"path":99,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":100,"sourceHtmlUrl":101},"references\u002Fplot_types.md",11839,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fmatplotlib\u002Freferences\u002Fplot_types.md",{"path":103,"resourceType":78,"resourceTypeDesc":79,"sizeBytes":104,"sourceHtmlUrl":105},"references\u002Fstyling_guide.md",13583,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fmatplotlib\u002Freferences\u002Fstyling_guide.md",{"path":107,"resourceType":108,"resourceTypeDesc":109,"sizeBytes":110,"sourceHtmlUrl":111},"scripts\u002Fplot_template.py","SCRIPT","脚本",12093,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fmatplotlib\u002Fscripts\u002Fplot_template.py",{"path":113,"resourceType":108,"resourceTypeDesc":109,"sizeBytes":114,"sourceHtmlUrl":115},"scripts\u002Fstyle_configurator.py",13179,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fscientific\u002Fmatplotlib\u002Fscripts\u002Fstyle_configurator.py",[117,146,173,206,241,265],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":126,"publishedAt":41},"01M70NHBTQ8BV0A2SCAZXEPHCX","wealthville-pool-scoring","Score DeFi liquidity pools before providing liquidity. Returns a 0-100 pool score and an Enter\u002FHold\u002FExit\u002FReduce\u002FAvoid verdict with calibrated confidence for ~68,800 Solana pools and 575 EVM pools, plus a public miss-inclusive track record. Use when asked whether a pool is worth LPing into, which pools look best right now, or how accurate the scores have actually been.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fweb-data\u002Fwealthville-pool-scoring\u002FSKILL.md",[123],{"categoryNo":124,"categoryName":125,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[127,128,129,130,131,28,132,133,134,135,136,137,138,139,140,141,142,143,144,145],"scoring","pool","wealthville pool scoring","liquidity","which","exit","now","use","when","reduce","with","record","track","verdict","evm","solana","how","public","look",{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":153,"publishedAt":41},"01M70MB6VR8ERJ4EM8D5KHBMEV","technical-debt-auditor","Scans a codebase and produces a quantified technical debt report with a prioritized remediation plan. Analyzes dead code, TODO\u002FFIXME\u002FHACK markers, dependency staleness, complexity hotspots, code duplication signals, test coverage gaps, unused exports, and outdated patterns. Use this skill when the user asks to audit their codebase for tech debt, wants a health check of their code quality, says things like \"where should I focus refactoring\", \"find code smells\", \"audit my codebase\", \"what technical debt do we have\", \"prioritize cleanup work\", or asks about code quality metrics. Also trigger when the user mentions \"code rot\", \"legacy cleanup\", \"refactoring priorities\", or wants to understand the overall health of a project before a major effort. Trigger even if the user doesn't say \"technical debt\" explicitly — any request to systematically assess code quality and identify improvement priorities belongs here.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fdevelopment\u002Ftechnical-debt-auditor\u002FSKILL.md",[152],{"categoryNo":124,"categoryName":125,"taxonomyType":21,"taxonomyTypeDesc":22},[154,155,156,157,158,159,160,161,162,163,164,135,165,166,167,168,169,170,171,172],"technical debt","debt","technical","technical debt auditor","auditor","coverage","complexity","markers","project","cleanup","unused","code","todo","work","plan","focus","signals","audit","dependency",{"skillNo":174,"name":175,"nameZh":6,"description":176,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":177,"categories":178,"keywords":188,"publishedAt":41},"01M70KPYH9QNHCNME5GJQGE22K","readonly-sql-guard","Make an agent's database access provably read-only. Use when an agent runs caller-supplied SQL against a production\u002FERP\u002Fanalytics database (a \"query\" MCP tool, text-to-SQL, an admin console), or when reviewing DB-access code for write\u002FDDL\u002Fside-effect\u002Ftransaction-escape risks. Checks what a statement CALLS, not just its shape.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fdatabase\u002Freadonly-sql-guard\u002FSKILL.md",[179,182,183],{"categoryNo":180,"categoryName":181,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":124,"categoryName":125,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":184,"categoryName":185,"taxonomyType":186,"taxonomyTypeDesc":187},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[189,190,191,192,193,194,195,28,196,197,198,199,200,201,202,134,203,204,135,205],"readonly","guard","sql guard","sql","readonly sql guard","erp","effect","read-only","db","just","tool","calls","only","MCP","access","database","query",{"skillNo":207,"name":208,"nameZh":6,"description":209,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":210,"licenseFileUrl":211,"sourceHtmlUrl":212,"categories":213,"keywords":217,"publishedAt":41},"01M6AFY6F7CC2BBZP1QD6VTNVC","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[214],{"categoryNo":215,"categoryName":216,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",[218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,28,240],"artifacts builder","web","web artifacts builder","artifacts","builder","state","routing","state management","component","css","frontend","ui","Tools","file","components","shadcn","react","Tailwind","suite","jsx","html","single-file","ui components",{"skillNo":242,"name":243,"nameZh":6,"description":244,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":210,"licenseFileUrl":245,"sourceHtmlUrl":246,"categories":247,"keywords":252,"publishedAt":41},"01M6AFWF33SFV9Z3SF4PEEE4BF","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[248,251],{"categoryNo":249,"categoryName":250,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":215,"categoryName":216,"taxonomyType":21,"taxonomyTypeDesc":22},[253,254,255,256,257,219,258,228,229,259,260,261,262,28,263,137,264],"webapp testing","testing","webapp","browser","playwright","applications","debugging","toolkit","logs","screenshots","local","behavior",{"skillNo":266,"name":267,"nameZh":6,"description":268,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":210,"licenseFileUrl":269,"sourceHtmlUrl":270,"categories":271,"keywords":279,"publishedAt":41},"01M6AF67Q67JJJ5V51JR2P52KA","discernment-nudge","After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or interpretation of data, factual claims they may rely on, or a multi-step argument — invoke this skill BEFORE finalizing your reply and then, if it applies, append 2-3 short follow-up questions, each tied to something specific in what you just produced, that help the user check key facts, probe the reasoning or assumptions, and notice missing context. Do this at most once per conversation. Skip it when the user asked a trivial how-to or simple lookup, wants a purely educational explanation, asked you only to format, convert, or assemble a file from content they provided, is writing code they will run, is doing creative writing or casual chat, or already asked you to double-check, cite, or review — the skill file explains these boundaries and the exact output format.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fdiscernment-nudge\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fdiscernment-nudge\u002FSKILL.md",[272,275,276],{"categoryNo":273,"categoryName":274,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":124,"categoryName":125,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":277,"categoryName":278,"taxonomyType":186,"taxonomyTypeDesc":187},"01JBSEEDCAT000000000000036","内容创作者",[280,281,282,283,284,285,286,287,221,288,231,165,289,290,291,292,293,201,294,135,295,296,297,298,299,143,300],"discernment nudge","nudge","interpretation","help","run","reasoning","data","writing","lookup","content","review","conversation","short","up","invoke","you","analysis","claims","argument","assemble","recommendations"]