Spirograph Python Matplotlib
What this skill does
This skill creates beginner-friendly Python scripts for creatives to generate spirograph-inspired artwork using Matplotlib.
The scripts produced by this skill:
- Accept user inputs for geometry and style.
- Ask for both background colour and main colour inputs.
- Support multiple colours for each palette and gradient blending.
- Ensure each output is unique by combining deterministic parameters with a uniqueness mechanism.
- Always save a PNG output file.
When to use it
Use this skill when the user asks for:
- Spirograph or hypotrochoid/epitrochoid-style art in Python.
- Generative art scripts that are easy to run and modify.
- Colourful creative outputs with gradients.
- Script-first workflows where PNG exports are required.
Do not use this skill for:
- Real-time GPU rendering pipelines.
- 3D engines or game frameworks.
- Non-Python stacks unless explicitly requested.
Inputs the generated script should support
At minimum, the generated script should ask for:
- Geometry controls:
R (outer radius)
r (inner radius)
d (offset)
points (sampling density)
rotations (curve coverage)
- Uniqueness controls:
seed (optional deterministic repeatability)
variation_strength (small randomized perturbation)
output_name (PNG filename stem)
- Styling controls:
background_colors (one or more colours)
main_colors (one or more colours)
use_gradient (yes/no)
line_width
alpha
figure_size
Colour input can be hex (#1f77b4), CSS-like names (gold), or comma-separated lists.
Instructions
- Confirm objective and constraints.
- Restate that the script will be easy to run, produce unique outputs, and save PNG files every run.
- Generate a single-file Python script first.
- Prefer one script (for example,
spirograph_art.py) with clear sections:
- input parsing
- colour parsing and gradient helpers
- curve generation
- rendering
- PNG export
- Implement spirograph math with stable defaults.
- Use a parametric curve (hypotrochoid or epitrochoid) and expose
R, r, d, points, and rotations.
- Validate numeric ranges and provide beginner-safe defaults.
- Enforce uniqueness per output.
- If
seed is provided, use it for deterministic uniqueness.
- If no
seed is provided, derive one from time + entropy.
- Apply controlled perturbations (
variation_strength) to one or more geometry or style parameters.
- Include the seed in the output filename or metadata text on-canvas.
- Implement background and main colour systems.
- Parse single or multi-colour input lists.
- If multiple colours are supplied and gradient is enabled:
- interpolate smoothly across the background and/or stroke colours.
- If gradient is disabled:
- cycle or randomly choose from provided palettes in a seed-controlled way.
- Render for visual quality.
- Use a high DPI figure.
- Hide axes and margins.
- Use anti-aliased lines.
- Centre and scale composition for balanced framing.
- Prefer dark-on-light or light-on-dark contrast checks when possible.
- Always export PNG.
- Save output on every run with
bbox_inches='tight' and consistent DPI.
- Confirm save path in terminal output.
- Never skip file export, even if display fails.
- Add usage instructions.
- Provide run command and one example input set.
- Keep explanation concise and creative-focused.
Quality checks
Before finalising, verify:
- Script runs with Python + Matplotlib only (unless user asks for extras).
- Both background and main colour prompts exist.
- Multi-colour and gradient behaviour works for both palettes.
- Two consecutive runs produce different outputs when no fixed seed is set.
- Same seed reproduces the same image.
- PNG file is always written.
Output format
When using this skill, produce:
- File edits:
- A runnable Python script (or minimal set of scripts) in the requested location.
- Short run instructions:
- Dependencies and command to execute.
- Save confirmation behaviour:
- Explain where PNGs are written and how names are generated.
- Optional creative presets:
- Include 2-3 input presets (for example: neon bloom, monochrome etch, sunset ribbon).
Example prompts
- "Create an easy Python spirograph script with gradient background and always save PNG."
- "Make a creative coding script for unique spirograph art; ask me for multiple background and line colours."
- "Build a Matplotlib spirograph generator with seed control and deterministic reruns."
Ambiguities to confirm with the user
If not specified, ask these before final implementation:
- Should this be CLI prompts, command-line arguments, or both?
- Should gradients apply to background only, main lines only, or both?
- Should uniqueness rely mostly on geometry variation, colour variation, or both?
- Preferred default canvas size and DPI?
If the user does not answer, default to:
- CLI prompts
- gradient support for both background and main lines
- mixed geometry + colour variation
figsize=(8, 8), dpi=300
1---2name: spirograph-python-matplotlib3description: Create easy Python scripts that generate beautiful, unique spirograph-style generative art with Matplotlib, support multi-colour or gradient background and main palettes, and always save the result as a PNG. Use when the user asks for creative coding, spirographs, procedural art, or quick art scripts with tunable inputs.4---56# Spirograph Python Matplotlib78## What this skill does910This skill creates beginner-friendly Python scripts for creatives to generate spirograph-inspired artwork using Matplotlib.1112The scripts produced by this skill:1314- Accept user inputs for geometry and style.15- Ask for both background colour and main colour inputs.16- Support multiple colours for each palette and gradient blending.17- Ensure each output is unique by combining deterministic parameters with a uniqueness mechanism.18- Always save a PNG output file.1920## When to use it2122Use this skill when the user asks for:2324- Spirograph or hypotrochoid/epitrochoid-style art in Python.25- Generative art scripts that are easy to run and modify.26- Colourful creative outputs with gradients.27- Script-first workflows where PNG exports are required.2829Do not use this skill for:3031- Real-time GPU rendering pipelines.32- 3D engines or game frameworks.33- Non-Python stacks unless explicitly requested.3435## Inputs the generated script should support3637At minimum, the generated script should ask for:3839- Geometry controls:40 - `R` (outer radius)41 - `r` (inner radius)42 - `d` (offset)43 - `points` (sampling density)44 - `rotations` (curve coverage)45- Uniqueness controls:46 - `seed` (optional deterministic repeatability)47 - `variation_strength` (small randomized perturbation)48 - `output_name` (PNG filename stem)49- Styling controls:50 - `background_colors` (one or more colours)51 - `main_colors` (one or more colours)52 - `use_gradient` (`yes`/`no`)53 - `line_width`54 - `alpha`55 - `figure_size`5657Colour input can be hex (`#1f77b4`), CSS-like names (`gold`), or comma-separated lists.5859## Instructions60611. Confirm objective and constraints.6263- Restate that the script will be easy to run, produce unique outputs, and save PNG files every run.64652. Generate a single-file Python script first.6667- Prefer one script (for example, `spirograph_art.py`) with clear sections:68 - input parsing69 - colour parsing and gradient helpers70 - curve generation71 - rendering72 - PNG export73743. Implement spirograph math with stable defaults.7576- Use a parametric curve (hypotrochoid or epitrochoid) and expose `R`, `r`, `d`, `points`, and `rotations`.77- Validate numeric ranges and provide beginner-safe defaults.78794. Enforce uniqueness per output.8081- If `seed` is provided, use it for deterministic uniqueness.82- If no `seed` is provided, derive one from time + entropy.83- Apply controlled perturbations (`variation_strength`) to one or more geometry or style parameters.84- Include the seed in the output filename or metadata text on-canvas.85865. Implement background and main colour systems.8788- Parse single or multi-colour input lists.89- If multiple colours are supplied and gradient is enabled:90 - interpolate smoothly across the background and/or stroke colours.91- If gradient is disabled:92 - cycle or randomly choose from provided palettes in a seed-controlled way.93946. Render for visual quality.9596- Use a high DPI figure.97- Hide axes and margins.98- Use anti-aliased lines.99- Centre and scale composition for balanced framing.100- Prefer dark-on-light or light-on-dark contrast checks when possible.1011027. Always export PNG.103104- Save output on every run with `bbox_inches='tight'` and consistent DPI.105- Confirm save path in terminal output.106- Never skip file export, even if display fails.1071088. Add usage instructions.109110- Provide run command and one example input set.111- Keep explanation concise and creative-focused.112113## Quality checks114115Before finalising, verify:116117- Script runs with Python + Matplotlib only (unless user asks for extras).118- Both background and main colour prompts exist.119- Multi-colour and gradient behaviour works for both palettes.120- Two consecutive runs produce different outputs when no fixed seed is set.121- Same seed reproduces the same image.122- PNG file is always written.123124## Output format125126When using this skill, produce:1271281. File edits:129- A runnable Python script (or minimal set of scripts) in the requested location.1301312. Short run instructions:132- Dependencies and command to execute.1331343. Save confirmation behaviour:135- Explain where PNGs are written and how names are generated.1361374. Optional creative presets:138- Include 2-3 input presets (for example: neon bloom, monochrome etch, sunset ribbon).139140## Example prompts141142- "Create an easy Python spirograph script with gradient background and always save PNG."143- "Make a creative coding script for unique spirograph art; ask me for multiple background and line colours."144- "Build a Matplotlib spirograph generator with seed control and deterministic reruns."145146## Ambiguities to confirm with the user147148If not specified, ask these before final implementation:149150- Should this be CLI prompts, command-line arguments, or both?151- Should gradients apply to background only, main lines only, or both?152- Should uniqueness rely mostly on geometry variation, colour variation, or both?153- Preferred default canvas size and DPI?154155If the user does not answer, default to:156157- CLI prompts158- gradient support for both background and main lines159- mixed geometry + colour variation160- `figsize=(8, 8)`, `dpi=300`