data-viz
Scannednpx machina-cli add skill pablodiegoo/Data-Pro-Skill/data-viz --openclawData Viz Skill
This skill provides a standardized way to generate high-quality statistical charts for reports. It handles styling (using Sebrae-compatible colors), layout, and saving to files.
Capabilities
1. Bar Charts (plot_bar)
Best for comparing categories or counts. Supports vertical and horizontal orientation.
2. Pie Charts (plot_pie)
Best for showing composition (shares) of a whole. Limit to Top 5-7 categories for readability.
3. Grouped Bar Charts (plot_grouped_bar)
Best for comparing distributions across segments.
4. Evolution Line Charts (Survey Specific)
Best for comparing means of domains across points in time (e.g., Start vs End). Use plot_evolution_line.
5. Word Clouds
For qualitative text analysis visualization. Use in conjunction with survey-qual-analyzer frequencies.
6. Multivariate Analysis (principal_component_plotting, correlation_ellipse_plot, multivariate_normal_contours)
- PCA: Scree plots, loadings, and biplots.
- Correlation: Ellipse plots for correlation matrices (publication style).
- Probability: Bivariate normal distribution contours.
7. Performance Visualization (performance_curve_builder)
- Performance Curves: Cumulative results over time for any strategy.
- Drawdown: Visualizing risk periods and recovery.
Usage
import pandas as pd
# Import from skill scripts directory
from scripts.plotter import plot_bar, plot_pie, plot_grouped_bar
from scripts.evolution_plotter import plot_evolution_line
from scripts.visuals import * # Additional visualization utilities
from scripts.advanced_plots import * # Advanced chart types
from scripts.principal_component_plotting import plot_feature_importance, plot_biplot
from scripts.correlation_ellipse_plot import plot_corr_ellipses
from scripts.multivariate_normal_contours import plot_contours
from scripts.performance_curve_builder import calculate_drawdown, extend_series_to_date
# 1. Simple Bar Chart (Top 10 Cities)
plot_bar(df, x_col="City", title="Respondents by City", filename="output/city_dist.png", orientation='h')
# 2. Evolution of Domains (Survey Pre vs Post)
# Expected columns: 'Cycle', 'Domain', 'Mean'
plot_evolution_line(df_evo, x="Cycle", y="Mean", hue="Domain", title="Evolution of Domains", filename="output/evolution.png")
Aesthetic Standards & Surveys
- Palette: Dark blue, cyan, and neutral grays for contrast.
- Labels: Always include sample size (n) if available.
- Premium: High DPI (300) and clean backgrounds for publication-ready reports.
Dependencies
Requires matplotlib, seaborn, and pandas.
Source
git clone https://github.com/pablodiegoo/Data-Pro-Skill/blob/main/src/datapro/data/skills/data-viz/SKILL.mdView on GitHub Overview
This skill standardizes the creation of high-quality statistical charts for reports. It handles styling with Sebrae-compatible colors, layout, and file output to visualize survey data, trends, and distributions clearly.
How This Skill Works
It exposes plotting helpers such as plot_bar, plot_pie, plot_grouped_bar, and plot_evolution_line, plus advanced plots for multivariate analysis and performance visualization. Built on matplotlib, seaborn, and pandas, it applies a consistent palette, informs labels with sample sizes when available, and saves charts to files.
When to Use It
- Compare category counts across groups with bar charts (top categories).
- Visualize changes over time using evolution line charts for means.
- Show composition of a whole with pie charts (limit to Top 5-7).
- Explore relationships with multivariate plots (PCA, correlations, contours).
- Assess performance and risk over time with performance curves and drawdowns.
Quick Start
- Step 1: Import plotting helpers (plot_bar, plot_pie, plot_grouped_bar) from the skill scripts.
- Step 2: Pass a pandas DataFrame with the required columns and a filename to the desired function.
- Step 3: Review the saved image and adjust palette, orientation, or labels as needed.
Best Practices
- Limit pie chart categories to top 5-7 for readability.
- Always show sample size (n) in labels when available.
- Use the Sebrae-compatible palette (dark blues, cyan, neutrals) for contrast.
- Output high-DPI images (300 DPI) with clean, publication-ready backgrounds.
- Save charts to files via the provided filename argument and verify paths.
Example Use Cases
- Plot respondents by City using a simple bar chart.
- Show evolution of survey domain means from Start to End.
- Compare distributions across segments with a grouped bar chart.
- Generate PCA loadings/biplots or correlation ellipses for multivariate insights.
- Visualize cumulative strategy performance and drawdown over time.