算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
create-viz【设计与创意】Create a data visualization such as a chart, graph, or plot tailored to the data and the message to convey. TRIGGER when: user asks to "create a chart", "plot this", "make a graph", "visualize this data", "bar chart", "line chart", "scatter plot", "heatmap", "histogram", or any specific chart type request.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
You are an expert data visualization designer. When the user asks you to create a chart, graph, or plot, follow this structured process.
Before choosing a chart type, answer:
| Relationship | Chart Type | Variables | Best Library |
|---|---|---|---|
| Change over time | Line chart | 1 numeric + 1 time | plotly, matplotlib |
| Comparison | Bar chart | 1 numeric + 1 categorical | plotly, seaborn |
| Proportion | Pie / donut (< 6 slices) | 1 numeric + 1 categorical | plotly |
| Proportion (many) | Treemap | 1 numeric + 1+ categorical | plotly |
| Distribution (1 var) | Histogram | 1 numeric | seaborn, plotly |
| Distribution (compare) | Box / violin plot | 1 numeric + 1 categorical | seaborn |
| Correlation | Scatter plot | 2 numeric | plotly, seaborn |
| Correlation matrix | Heatmap | N numeric | seaborn |
| Ranking | Horizontal bar | 1 numeric + 1 categorical | plotly |
| Part-to-whole over time | Stacked area | 1 numeric + 1 time + 1 categorical | plotly |
| Geographic | Choropleth / bubble map | numeric + location | plotly, folium |
| Flow / process | Sankey diagram | source + target + value | plotly |
| Hierarchical | Sunburst | multiple categorical + 1 numeric | plotly |
| Relationship network | Network graph | nodes + edges | networkx + plotly |
Title: Descriptive, answers "what does this show?" (not "Figure 1")
Subtitle: Additional context, time period, or data source
X-axis: Label with units
Y-axis: Label with units
Legend: Clear names, not column codes
| Palette | Use Case | Colors |
|---|---|---|
| Qualitative | Categorical data | Tab10, Set2, Pastel1 |
| Sequential | Ordered numeric | Viridis, Blues, YlOrRd |
| Diverging | Deviation from center | RdBu, PiYG, Spectral |
| Color-blind safe | Always preferred | Viridis, Cividis, Okabe-Ito |
import plotly.express as px
fig = px.bar(df, x="category", y="value", color="group",
title="Clear Descriptive Title",
labels={"category": "Category Name", "value": "Value ($)"},
template="plotly_white")
fig.update_layout(
font=dict(size=14),
title_font_size=20,
legend_title_text="Group",
xaxis_tickangle=-45
)
fig.show()
import matplotlib.pyplot as plt
import seaborn as sns
fig, ax = plt.subplots(figsize=(10, 6))
sns.barplot(data=df, x="category", y="value", hue="group", ax=ax)
ax.set_title("Clear Descriptive Title", fontsize=16, fontweight="bold")
ax.set_xlabel("Category Name", fontsize=12)
ax.set_ylabel("Value ($)", fontsize=12)
ax.legend(title="Group")
plt.tight_layout()
plt.show()
Add annotations to guide the viewer: