Create Visualization
by ThepExcel
Creates diagrams and animations for STEM education using Matplotlib and Manim. Use for physics diagrams (FBD, vectors), math plots (functions, geometry), flowcharts, or 3Blue1Brown-style animations.
Skill Details
Repository Files
4 files in this skill directory
name: create-visualization description: Creates diagrams and animations for STEM education using Matplotlib and Manim. Use for physics diagrams (FBD, vectors), math plots (functions, geometry), flowcharts, or 3Blue1Brown-style animations.
Visualization Skill
สร้าง diagrams และ animations สำหรับอธิบาย STEM concepts
Quick Decision
| Need | Tool | Script |
|---|---|---|
| Physics FBD | Matplotlib | scripts/physics_fbd.py |
| Math plots/geometry | Matplotlib | scripts/math_plots.py |
| Flowcharts | Matplotlib | scripts/flowchart.py |
| Animations (3b1b style) | Manim | scripts/manim_physics.py |
Rule: Static → Matplotlib (fast) | Motion/transform → Manim (powerful)
1. Physics: Free Body Diagrams
from scripts.physics_fbd import draw_inclined_plane_fbd, draw_two_blocks_rope
# Inclined plane with force decomposition
draw_inclined_plane_fbd(mass=4, angle=30, show_components=True)
# Two blocks connected by rope
draw_two_blocks_rope(mass_A=2, mass_B=3, F_pull=10)
Output: PNG in learning-notes/ folder
2. Math: Plots & Geometry
from scripts.math_plots import plot_function, draw_unit_circle, draw_coordinate_plane
import numpy as np
# Function plot
plot_function(lambda x: np.sin(x), x_range=(-2*np.pi, 2*np.pi), title="sin(x)")
# Unit circle with angles
draw_unit_circle(angles_deg=[0, 30, 45, 60, 90])
# Coordinate plane with vectors
draw_coordinate_plane(
vectors=[((0,0), (3,2), "a", "red"), ((0,0), (1,4), "b", "blue")]
)
3. Flowcharts
from scripts.flowchart import draw_simple_flowchart, draw_decision_flowchart
# Linear flow
draw_simple_flowchart([
("Start", "start"),
("Input x", "io"),
("Process", "process"),
("End", "end"),
])
# Decision branching
draw_decision_flowchart(
before_decision=[("Start", "start")],
decision_text="x > 0?",
yes_branch=[("Positive", "process")],
no_branch=[("Negative", "process")],
after_merge=[("End", "end")]
)
4. Animations (Manim)
For 3Blue1Brown-style animations. See references/manim-guide.md for full guide.
Available Scenes in scripts/manim_physics.py
| Scene | Description |
|---|---|
VectorAddition |
Head-to-tail vector addition |
ForcesOnBox |
FBD with motion |
NewtonThirdLaw |
Action-reaction pairs |
InclinedPlane |
Forces on incline with equations |
ProjectileMotion |
Parabolic path with velocity vectors |
CircularMotion |
Centripetal acceleration |
AtwoodIncline |
Pulley system (customizable m1, m2, θ) |
Render Command
# Preview (low quality, fast)
manim -pql scripts/manim_physics.py VectorAddition
# GIF output
manim -ql --format=gif scripts/manim_physics.py VectorAddition
Custom Animation
from manim import *
class MyScene(Scene):
def construct(self):
circle = Circle(color=BLUE)
self.play(Create(circle))
self.play(circle.animate.shift(RIGHT * 2))
5. Function Explainer Visualization
สร้างภาพอธิบายการทำงานของ Excel/DAX/Power Query functions
Quick Start
# 1. Generate visualization
python3 tools/visualize_function.py excel left 1
# 2. Upload to server (--mkdir creates directory if needed)
python3 tools/ftp_upload.py -f media/function-viz/excel/left-1.png -r wp-content/uploads/function-viz/excel/ --mkdir
# 3. Add image_url to JSON example, then publish
python3 tools/smart_publish.py --slugs left --program excel --allow
Output: media/function-viz/{program}/{slug}-{example_number}.png
Server: https://www.thepexcel.com/wp-content/uploads/function-viz/{program}/{slug}-{example}.png
Supported Functions
| Function | Description |
|---|---|
| LEFT | ดึงตัวอักษรจากซ้าย |
| RIGHT | ดึงตัวอักษรจากขวา |
| MID | ดึงตัวอักษรจากตรงกลาง |
| FIND | หาตำแหน่งข้อความ |
| SUBSTITUTE | แทนที่ข้อความ |
Workflow
- Generate —
python3 tools/visualize_function.py {program} {slug} {example_num} - Upload —
python3 tools/ftp_upload.py -f {file} -r wp-content/uploads/function-viz/{program}/ --mkdir - Update JSON — เพิ่ม
"image_url": "https://..."ใน example - Publish —
python3 tools/smart_publish.py --slugs {slug} --program {program} --allow
Custom Visualization (Nested Functions)
สำหรับ formula ซับซ้อน เช่น =LEFT(A1, FIND(" ", A1)-1) ต้องเขียน script แยก:
# ดูตัวอย่างที่ media/function-viz/excel/left-5-custom.py
Note: Script หลักรองรับ formula ง่ายๆ ที่มี string literal เท่านั้น
Workflow
- Choose tool — Static (Matplotlib) vs Animation (Manim)
- Run script —
python3 scripts/physics_fbd.pyormanim -pql ... - View output —
explorer.exe output.pngor use image viewer
Tip: Use run_in_background=true for viewers to avoid blocking conversation.
Related Skills (Optional)
| When | Suggest |
|---|---|
| AI-generated images/videos (realistic, artistic) | /prompt-ai-image-video - prompt engineering |
| Teaching concepts with visuals | /explain-concepts - ACES methodology |
| Need facts before visualizing | /deep-research - verify data |
| Problem-solving context | /problem-solving - structured thinking |
Note: Use /create-visualization for technical diagrams (FBD, plots, flowcharts). Use /prompt-ai-image-video for AI-generated realistic/artistic images and videos.
Related Skills
Team Composition Analysis
This skill should be used when the user asks to "plan team structure", "determine hiring needs", "design org chart", "calculate compensation", "plan equity allocation", or requests organizational design and headcount planning for a startup.
Startup Financial Modeling
This skill should be used when the user asks to "create financial projections", "build a financial model", "forecast revenue", "calculate burn rate", "estimate runway", "model cash flow", or requests 3-5 year financial planning for a startup.
Startup Metrics Framework
This skill should be used when the user asks about "key startup metrics", "SaaS metrics", "CAC and LTV", "unit economics", "burn multiple", "rule of 40", "marketplace metrics", or requests guidance on tracking and optimizing business performance metrics.
Market Sizing Analysis
This skill should be used when the user asks to "calculate TAM", "determine SAM", "estimate SOM", "size the market", "calculate market opportunity", "what's the total addressable market", or requests market sizing analysis for a startup or business opportunity.
Anndata
This skill should be used when working with annotated data matrices in Python, particularly for single-cell genomics analysis, managing experimental measurements with metadata, or handling large-scale biological datasets. Use when tasks involve AnnData objects, h5ad files, single-cell RNA-seq data, or integration with scanpy/scverse tools.
Geopandas
Python library for working with geospatial vector data including shapefiles, GeoJSON, and GeoPackage files. Use when working with geographic data for spatial analysis, geometric operations, coordinate transformations, spatial joins, overlay operations, choropleth mapping, or any task involving reading/writing/analyzing vector geographic data. Supports PostGIS databases, interactive maps, and integration with matplotlib/folium/cartopy. Use for tasks like buffer analysis, spatial joins between dat
Market Research Reports
Generate comprehensive market research reports (50+ pages) in the style of top consulting firms (McKinsey, BCG, Gartner). Features professional LaTeX formatting, extensive visual generation with scientific-schematics and generate-image, deep integration with research-lookup for data gathering, and multi-framework strategic analysis including Porter's Five Forces, PESTLE, SWOT, TAM/SAM/SOM, and BCG Matrix.
Plotly
Interactive scientific and statistical data visualization library for Python. Use when creating charts, plots, or visualizations including scatter plots, line charts, bar charts, heatmaps, 3D plots, geographic maps, statistical distributions, financial charts, and dashboards. Supports both quick visualizations (Plotly Express) and fine-grained customization (graph objects). Outputs interactive HTML or static images (PNG, PDF, SVG).
Excel Analysis
Analyze Excel spreadsheets, create pivot tables, generate charts, and perform data analysis. Use when analyzing Excel files, spreadsheets, tabular data, or .xlsx files.
Neurokit2
Comprehensive biosignal processing toolkit for analyzing physiological data including ECG, EEG, EDA, RSP, PPG, EMG, and EOG signals. Use this skill when processing cardiovascular signals, brain activity, electrodermal responses, respiratory patterns, muscle activity, or eye movements. Applicable for heart rate variability analysis, event-related potentials, complexity measures, autonomic nervous system assessment, psychophysiology research, and multi-modal physiological signal integration.
