--- name: data-visualizer description: "Creates professional charts, graphs, and dashboards from structured data. Use for: data storytelling, trend visualization, and creating presentation-ready assets using Python (Matplotlib, Seaborn, Plotly)." --- # Data Visualizer This skill focuses on transforming raw data into compelling visual stories. It provides a framework for selecting the right visualization types and implementing them with high aesthetic standards. ## Visualization Principles ### 1. Chart Selection Logic - **Trends over Time**: Use Line Charts or Area Charts. - **Comparisons**: Use Bar Charts (Horizontal for long labels) or Column Charts. - **Distributions**: Use Histograms or Box Plots. - **Relationships**: Use Scatter Plots or Heatmaps. - **Parts-to-Whole**: Use Stacked Bar Charts or (sparingly) Pie Charts. ### 2. Design Standards - **Clarity**: Ensure all axes are labeled, units are specified, and legends are clear. - **Consistency**: Use a unified color palette across all charts in a single report. - **Focus**: Highlight the most important data point (e.g., using a contrasting color). ## Python Implementation Guide When generating visualizations, use the following libraries based on the requirement: - **Matplotlib/Seaborn**: Best for static, publication-quality figures. - **Plotly**: Best for interactive charts and web-based dashboards. ### Template Code Snippet (Seaborn) '''python import seaborn as sns import matplotlib.pyplot as plt def create_styled_chart(df, x_col, y_col, title): sns.set_theme(style="whitegrid") plt.figure(figsize=(10, 6)) ax = sns.barplot(data=df, x=x_col, y=y_col, palette="viridis") ax.set_title(title, fontsize=16, pad=20) plt.tight_layout() plt.savefig(\'output_chart.png\', dpi=300) ''' ## Recommended Workflow 1. **Data Cleaning**: Inspect the dataframe for missing values or outliers before plotting. 2. **Goal Definition**: Determine the primary message the visualization should convey. 3. **Execution**: Write and execute Python code to generate the asset. 4. **Refinement**: Adjust labels, colors, and titles for maximum impact.