Diagram & Plot Generator (Gruvbox Dark Theme)
Generate PlantUML diagrams and gnuplot visualizations with a consistent Gruvbox dark theme.
Arguments
- •
$ARGUMENTS: Description of what the user wants to visualize (optional)
If no arguments provided, ask the user what they want to visualize.
Instructions
Step 0: Choose the right tool
Based on what the user wants to visualize, select the appropriate tool:
Use gnuplot for:
- •Function plots (sin, cos, polynomials, custom functions)
- •Waveforms and signal comparisons
- •Data series / scatter plots / histograms / bar charts
- •Mathematical visualizations
- •Performance benchmarks and time series
- •Anything with numeric axes or data-driven charts
Use PlantUML for:
- •Entity-relationship diagrams (ERDs)
- •Class diagrams, type hierarchies
- •Sequence diagrams, request/response flows
- •Component / deployment / architecture diagrams
- •State machines, activity / workflow diagrams
- •Flowcharts
Then follow the corresponding section below.
gnuplot Path
- •
Understand the request: Determine the plot type, data source, axis labels, and title.
- •
Determine output path: If not specified, use
docs/<name>.gnuplotfor the script anddocs/<name>.pngfor the image. - •
Create the gnuplot script using the theme template from template.gnuplot:
- •Copy the full styling preamble (terminal, colors, border, grid, tics, key, labels)
- •Set
set output '<png-path>'to the desired PNG output path - •Use the named color variables (
col_red,col_green,col_yellow, etc.) for plot lines and fills - •Set a descriptive title with
set title "{/:Bold Your Title}" tc rgb '#fabd2f' font ',16' - •Add axis labels, ranges, and tics as needed
- •
Generate the PNG by running:
gnuplot <script-path> 2>&1 - •
Verify generation succeeded:
- •Check the PNG file exists:
test -f <png-path> && stat --format="%s bytes" <png-path> - •If gnuplot reported errors, diagnose and fix the script
- •Check the PNG file exists:
- •
Display the result (only after verification succeeds):
feh <generated-png-path> &
PlantUML Path
- •
Understand the request: Based on what the user wants to diagram, infer the best diagram type:
- •Database schemas, tables, relationships → ERD (entity-relationship)
- •Code structure, types, inheritance → Class diagram
- •Request/response flows, API calls, interactions → Sequence diagram
- •System architecture, services, modules → Component diagram
- •Workflows, state machines, lifecycles → State or Activity diagram
- •
Determine output path: If not specified, use a sensible default like
docs/<name>.puml - •
Create the PlantUML file using the theme template from template.puml
- •
Generate the PNG by running:
plantuml -tpng <output-path> 2>&1 - •
Verify generation succeeded:
- •Important: PlantUML names the output file based on
@startuml <name>, not the input filename - •If
@startuml foois indocs/bar.puml, the output will bedocs/foo.png - •To match input filename, use
@startumlwithout a name, or match the name to the filename - •Check the PNG file exists:
test -f <png-path> && stat --format="%s bytes" <png-path> - •If the file doesn't exist, run with
-vflag to see where output is written - •If plantuml reported errors, diagnose and fix the
.pumlfile
- •Important: PlantUML names the output file based on
- •
Display the result (only after verification succeeds):
feh <generated-png-path> &
Color Palette Reference
See colors.md for the full Gruvbox color palette with both PlantUML and gnuplot variable names.
Quick Reference
- •Background:
#282828(bg),#32302f(bg0_s),#3c3836(bg1) - •Foreground:
#ebdbb2(fg),#d5c4a1(fg2) - •Red:
#fb4934(bright),#cc241d(normal) - •Green:
#b8bb26(bright),#98971a(normal) - •Yellow:
#fabd2f(bright),#d79921(normal) - •Blue:
#83a598(bright),#458588(normal) - •Purple:
#d3869b(bright),#b16286(normal) - •Aqua:
#8ec07c(bright),#689d6a(normal) - •Orange:
#fe8019(bright),#d65d0e(normal)
Styling Guidelines
- •Use
#32302ffor element backgrounds (slightly lighter than main bg) - •Use
#3c3836for headers/sections - •Use
#83a598(blue) for borders and relationships - •Use
#fabd2f(yellow) for titles and entity names - •Use
#8ec07c(aqua) for data types - •Use
#fb4934(red) for required/important markers - •Use
#fe8019(orange) for keys (PK, FK) - •Use
#d3869b(purple) for constraints - •Use
#b8bb26(green) for relationship labels