Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

python-plotting

БесплатноБез исполняемых скриптовНе проверен

Comprehensive plotting and visualization in Python - matplotlib (static publication-quality plots), seaborn (statistical visualization), and plotly…

jkitchinот jkitchin★ 45 звёзд на GitHub25 установок в других каталогах

Об этом скилле

Python Plotting & Visualization

Overview

Master data visualization in Python through three complementary libraries: matplotlib (foundational static plots), seaborn (statistical visualization), and plotly (interactive graphics). Each library has distinct strengths, and knowing when to use which—or how to combine them—is key to effective data communication.

Core value: Create publication-quality static plots, insightful statistical graphics, and interactive dashboards with the right tool for each visualization need.

Library Selection Guide

Matplotlib - The Foundation

Use when:

  • Need fine-grained control over every plot element
  • Creating publication-quality static figures
  • Building custom visualizations not available elsewhere
  • Working with low-level plotting requirements
  • Need maximum compatibility (most widely supported)

Strengths:

  • Complete control over every visual element
  • Mature, stable, extensively documented
  • Foundation for seaborn and other libraries
  • Export to any format (PDF, SVG, PNG, etc.)
  • Extensive customization options

Weaknesses:

  • Verbose for common statistical plots
  • Steeper learning curve for complex plots
  • Static output (no interactivity)
  • Default aesthetics less modern

Seaborn - Statistical Visualization

Use when:

  • Creating statistical plots (distributions, correlations, regressions)
  • Need attractive defaults with minimal code
  • Working with pandas DataFrames
  • Want automatic statistical estimation
  • Need faceted/multi-panel plots

Strengths:

  • Concise syntax for statistical plots
  • Beautiful default themes
  • Built-in statistical estimation
  • Seamless pandas integration
  • FacetGrid for complex multi-panel layouts

Weaknesses:

  • Less control than matplotlib
  • Limited to statistical plot types
  • Static output only
  • Requires understanding of underlying matplotlib for deep customization

Plotly - Interactive Visualization

Use when:

  • Need interactive plots (zoom, hover, pan)
  • Building dashboards or web apps
  • Want 3D visualizations
  • Need animations
  • Sharing exploratory analysis

Strengths:

  • Rich interactivity out-of-the-box
  • Beautiful defaults
  • 3D and geographic plotting
  • Integration with Dash for web apps
  • Export to HTML for sharing

Weaknesses:

  • Larger file sizes
  • Less control than matplotlib for publications
  • Different API paradigm
  • Not ideal for static publication figures

Quick Decision Tree

Need interactivity?
├─ Yes → Plotly
└─ No → Statistical plot?
    ├─ Yes → Seaborn (can customize with matplotlib)
    └─ No → Complex customization needed?
        ├─ Yes → Matplotlib
        └─ No → Seaborn or Matplotlib (preference)

Matplotlib - Foundational Plotting

Two APIs: pyplot vs Object-Oriented

pyplot (MATLAB-style, implicit state):

import matplotlib.pyplot as plt

# Quick and interactive
plt.plot([1, 2, 3], [1, 4, 9])
plt.xlabel('x')
plt.ylabel('y')
plt.title('Simple Plot')
plt.show()

Object-Oriented (explicit, recommended for complex plots):

import matplotlib.pyplot as plt

# Explicit control
fig, ax = plt.subplots()
ax.plot([1, 2, 3], [1, 4, 9])
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_title('Simple Plot')
plt.show()

Recommendation: Use OO API for scripts, functions, and complex plots. Use pyplot for quick interactive exploration.

Figure Anatomy

import matplotlib.pyplot as plt
import numpy as np

# Create figure with subplots
fig, axes = plt.subplots(2, 2, figsize=(10, 8))

# fig = Figure (entire window)
# axes = array of Axes (individual plots)

# Access individual axes
ax1 = axes[0, 0]  # Top left
ax2 = axes[0, 1]  # Top right
ax3 = axes[1, 0]  # Bottom left
ax4 = axes[1, 1]  # Bottom right

# Plot on each axes
ax1.plot([1, 2, 3], [1, 4, 9])
ax2.scatter([1, 2, 3], [1, 4, 9])
ax3.bar([1, 2, 3], [1, 4, 9])
ax4.hist(np.random.randn(1000))

# Adjust layout
plt.tight_layout()
plt.show()

Common Plot Types

Line Plot:

fig, ax = plt.subplots()

x = np.linspace(0, 10, 100)
y1 = np.sin(x)
y2 = np.cos(x)

ax.plot(x, y1, label='sin(x)', linewidth=2, color='blue', linestyle='-')
ax.plot(x, y2, label='cos(x)', linewidth=2, color='red', linestyle='--')

ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_title('Trigonometric Functions')
ax.legend()
ax.grid(True, alpha=0.3)
plt.show()

Scatter Plot:

fig, ax = plt.subplots()

x = np.random.randn(100)
y = 2*x + np.random.randn(100)*0.5
colors = np.random.rand(100)
sizes = 100 * np.random.rand(100)

scatter = ax.scatter(x, y, c=colors, s=sizes, alpha=0.6, cmap='viridis')

ax.set_xlabel('X')
ax.set_ylabel('Y')
ax.set_title('Scatter Plot with Color and Size')

# Add colorbar
plt.colorbar(scatter, ax=ax, label='Color Value')
plt.show()

Bar Plot:

fig, ax = plt.subplots()

categories = ['A', 'B', 'C', 'D', 'E']
values = [23, 45, 56, 78, 32]

bars = ax.bar(categories, values, color=['red', 'blue', 'green', 'orange'
Полный SKILL.md на GitHub

Установить python-plotting в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

*

FAQ

Что делает скилл python-plotting?

Comprehensive plotting and visualization in Python - matplotlib (static publication-quality plots), seaborn (statistical visualization), and plotly (interactive plots); includes plot types, customization, best practices, and library selection guidance

Как установить скилл python-plotting?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл python-plotting запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить python-plotting с