Create Visualizations
If you see unfamiliar placeholders or need to check which tools are connected, please ask about available integrations.
Create publication-quality data visualizations using Python. Generates charts from data with best practices for clarity, accuracy, and design.
Usage
You can ask to create a visualization from a data source (e.g., "Create a line chart of monthly revenue" or "Visualize this data").
Arguments
data source — Query results, pasted data, CSV/Excel file, or data to be queried
chart type — (Optional) Explicit chart type (e.g., "bar chart", "heatmap")
Workflow
1. Understand the Request
Determine:
- Data source: Query results, pasted data, CSV/Excel file, or data to be queried
- Chart type: Explicitly requested or needs to be recommended
- Purpose: Exploration, presentation, report, dashboard component
- Audience: Technical team, executives, external stakeholders
2. Get the Data
If data warehouse is connected and data needs querying:
- Write and execute the query
- Load results into a pandas DataFrame
If data is pasted or uploaded:
- Parse the data into a pandas DataFrame
- Clean and prepare as needed (type conversions, null handling)
If data is from a previous analysis in the conversation:
- Reference the existing data
3. Select Chart Type
If the user didn't specify a chart type, recommend one based on the data and question:
| Data Relationship |
Recommended Chart |
| Trend over time |
Line chart |
| Comparison across categories |
Bar chart (horizontal if many categories) |
| Part-to-whole composition |
Stacked bar or area chart (avoid pie charts unless <6 categories) |
| Distribution of values |
Histogram or box plot |
| Correlation between two variables |
Scatter plot |
| Two-variable comparison over time |
Dual-axis line or grouped bar |
| Geographic data |
Choropleth map |
| Ranking |
Horizontal bar chart |
| Flow or process |
Sankey diagram |
| Matrix of relationships |
Heatmap |
Explain the recommendation briefly if the user didn't specify.
4. Generate the Visualization
Write Python code using one of these libraries based on the need:
- matplotlib + seaborn: Best for static, publication-quality charts. Default choice.
- plotly: Best for interactive charts or when the user requests interactivity.
Code requirements:
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
# Set professional style
plt.style.use('seaborn-v0_8-whitegrid')
sns.set_palette("husl")
# Create figure with appropriate size
fig, ax = plt.subplots(figsize=(10, 6))
# [chart-specific code]
# Always include:
ax.set_title('Clear, Descriptive Title', fontsize=14, fontweight='bold')
ax.set_xlabel('X-Axis Label', fontsize=11)
ax.set_ylabel('Y-Axis Label', fontsize=11)
# Format numbers appropriately
# - Percentages: '45.2%' not '0.452'
# - Currency: '$1.2M' not '1200000'
# - Large numbers: '2.3K' or '1.5M' not '2300' or '1500000'
# Remove chart junk
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
plt.tight_layout()
plt.savefig('chart_name.png', dpi=150, bbox_inches='tight')
plt.show()
5. Apply Design Best Practices
Color:
- Use a consistent, colorblind-friendly palette
- Use color meaningfully (not decoratively)
- Highlight the key data point or trend with a contrasting color
- Grey out less important reference data
Typography:
- Descriptive title that states the insight, not just the metric (e.g., "Revenue grew 23% YoY" not "Revenue by Month")
- Readable axis labels (not rotated 90 degrees if avoidable)
- Data labels on key points when they add clarity
Layout:
- Appropriate whitespace and margins
- Legend placement that doesn't obscure data
- Sorted categories by value (not alphabetically) unless there's a natural order
Accuracy:
- Y-axis starts at zero for bar charts
- No misleading axis breaks without clear notation
- Consistent scales when comparing panels
- Appropriate precision (don't show 10 decimal places)
6. Save and Present
- Save the chart as a PNG file with descriptive name
- Display the chart to the user
- Provide the code used so they can modify it
- Suggest variations (different chart type, different grouping, zoomed time range)
Tips
- If you want interactive charts (hover, zoom, filter), mention "interactive" and I will use plotly
- Specify "presentation" if you need larger fonts and higher contrast
- You can request multiple charts at once (e.g., "create a 2x2 grid of charts showing...")
- Charts are saved to your current directory as PNG files
1---2name: data-create-viz3description: Create publication-quality visualizations with Python4---56# Create Visualizations78> If you see unfamiliar placeholders or need to check which tools are connected, please ask about available integrations.910Create publication-quality data visualizations using Python. Generates charts from data with best practices for clarity, accuracy, and design.1112## Usage1314You can ask to create a visualization from a data source (e.g., "Create a line chart of monthly revenue" or "Visualize this data").1516### Arguments1718- `data source` — Query results, pasted data, CSV/Excel file, or data to be queried19- `chart type` — (Optional) Explicit chart type (e.g., "bar chart", "heatmap")2021### Workflow2223### 1. Understand the Request2425Determine:2627- **Data source**: Query results, pasted data, CSV/Excel file, or data to be queried28- **Chart type**: Explicitly requested or needs to be recommended29- **Purpose**: Exploration, presentation, report, dashboard component30- **Audience**: Technical team, executives, external stakeholders3132### 2. Get the Data3334**If data warehouse is connected and data needs querying:**35361. Write and execute the query372. Load results into a pandas DataFrame3839**If data is pasted or uploaded:**40411. Parse the data into a pandas DataFrame422. Clean and prepare as needed (type conversions, null handling)4344**If data is from a previous analysis in the conversation:**45461. Reference the existing data4748### 3. Select Chart Type4950If the user didn't specify a chart type, recommend one based on the data and question:5152| Data Relationship | Recommended Chart |53| --------------------------------- | ----------------------------------------------------------------- |54| Trend over time | Line chart |55| Comparison across categories | Bar chart (horizontal if many categories) |56| Part-to-whole composition | Stacked bar or area chart (avoid pie charts unless <6 categories) |57| Distribution of values | Histogram or box plot |58| Correlation between two variables | Scatter plot |59| Two-variable comparison over time | Dual-axis line or grouped bar |60| Geographic data | Choropleth map |61| Ranking | Horizontal bar chart |62| Flow or process | Sankey diagram |63| Matrix of relationships | Heatmap |6465Explain the recommendation briefly if the user didn't specify.6667### 4. Generate the Visualization6869Write Python code using one of these libraries based on the need:7071- **matplotlib + seaborn**: Best for static, publication-quality charts. Default choice.72- **plotly**: Best for interactive charts or when the user requests interactivity.7374**Code requirements:**7576```python77import matplotlib.pyplot as plt78import seaborn as sns79import pandas as pd8081# Set professional style82plt.style.use('seaborn-v0_8-whitegrid')83sns.set_palette("husl")8485# Create figure with appropriate size86fig, ax = plt.subplots(figsize=(10, 6))8788# [chart-specific code]8990# Always include:91ax.set_title('Clear, Descriptive Title', fontsize=14, fontweight='bold')92ax.set_xlabel('X-Axis Label', fontsize=11)93ax.set_ylabel('Y-Axis Label', fontsize=11)9495# Format numbers appropriately96# - Percentages: '45.2%' not '0.452'97# - Currency: '$1.2M' not '1200000'98# - Large numbers: '2.3K' or '1.5M' not '2300' or '1500000'99100# Remove chart junk101ax.spines['top'].set_visible(False)102ax.spines['right'].set_visible(False)103104plt.tight_layout()105plt.savefig('chart_name.png', dpi=150, bbox_inches='tight')106plt.show()107```108109### 5. Apply Design Best Practices110111**Color:**112113- Use a consistent, colorblind-friendly palette114- Use color meaningfully (not decoratively)115- Highlight the key data point or trend with a contrasting color116- Grey out less important reference data117118**Typography:**119120- Descriptive title that states the insight, not just the metric (e.g., "Revenue grew 23% YoY" not "Revenue by Month")121- Readable axis labels (not rotated 90 degrees if avoidable)122- Data labels on key points when they add clarity123124**Layout:**125126- Appropriate whitespace and margins127- Legend placement that doesn't obscure data128- Sorted categories by value (not alphabetically) unless there's a natural order129130**Accuracy:**131132- Y-axis starts at zero for bar charts133- No misleading axis breaks without clear notation134- Consistent scales when comparing panels135- Appropriate precision (don't show 10 decimal places)136137### 6. Save and Present1381391. Save the chart as a PNG file with descriptive name1402. Display the chart to the user1413. Provide the code used so they can modify it1424. Suggest variations (different chart type, different grouping, zoomed time range)143144## Tips145146- If you want interactive charts (hover, zoom, filter), mention "interactive" and I will use plotly147- Specify "presentation" if you need larger fonts and higher contrast148- You can request multiple charts at once (e.g., "create a 2x2 grid of charts showing...")149- Charts are saved to your current directory as PNG files