Skip to main content
skill CX Codex

plotext-financial-chart — Claude Code skill: setup guide

plotext-financial-chart builds pure text financial line charts for Markdown files using plotext. It helps display price paths directly in GitHub documentation without external images.

MIT 146 installs ★ 3 updated 2026-10-25

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add terrylica/cc-skills --skill plotext-financial-chart -a claude-code
Open on GitHub

What plotext-financial-chart does

The skill generates ASCII price charts formatted specifically for GitHub Flavored Markdown. It uses the dot marker (•) so characters stay aligned across monospace viewers, terminals, and GitHub code blocks.

Rendering relies on a Python script running plotext. Every run clears previous state with plt.clear_figure(), strips ANSI escape codes with regular expressions, and sizes output to plt.plotsize(65, 22) to fit inside standard 80-column blocks. The markdown formatting rule requires placing a <details> block with the Python source immediately below the chart.

Execution fails if Python 3 and the plotext package are not present in your environment.

What it helps with

  • render ASCII price charts directly in GitHub Flavored Markdown
  • display trading thresholds and barriers without exporting images
  • strip ANSI color codes from terminal plotting output
  • embed reproducible Python plotting scripts inside markdown details blocks

Example prompts for the agent

  • Draw an ASCII price chart with barriers at 97 and 103 using plotext
  • Generate a markdown financial chart showing entry levels for my README

How to install plotext-financial-chart

1Skills CLI (Vercel)

npx skills add terrylica/cc-skills --skill plotext-financial-chart -a claude-code

2Manually: put the files in place

~/.claude/skills/plotext-financial-chart/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/plotext-financial-chart/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about plotext-financial-chart

How to install plotext-financial-chart in Claude Code?

Run npx skills add terrylica/cc-skills --skill plotext-financial-chart -a claude-code.

What does plotext-financial-chart do?

It generates plain-text line charts using the Python plotext package. Charts use dot markers so they render cleanly in monospace markdown viewers.

What dependencies are required for plotext-financial-chart?

You need Python 3, an installer like pip3 or uv pip, and the plotext library.

Source text

SKILL.md · MIT
---
name: plotext-financial-chart
description: ASCII financial line charts for markdown using plotext dot marker. TRIGGERS - financial chart, line chart, plotext
allowed-tools: Read, Bash, Write, Edit
---

# Plotext Financial Chart Skill

Create ASCII financial line charts for GitHub Flavored Markdown using plotext with dot marker (`•`). Pure text output — renders correctly on GitHub, terminals, and all monospace environments.

> **Self-Evolving Skill**: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.

## When to Use This Skill

- Adding price path / line chart diagrams to markdown documentation
- Visualizing trading concepts (barriers, thresholds, entry/exit levels)
- Any GFM markdown file needing financial data visualization
- User mentions "financial chart", "line chart", "price chart", "plotext", or "trading chart"

**NOT for**: Flowcharts or architecture diagrams.

## Preflight Check

### All-in-One Preflight Script

```bash
/usr/bin/env bash << 'PREFLIGHT_EOF'
python3 --version &>/dev/null || { echo "ERROR: Python 3 not found"; exit 1; }
if command -v uv &>/dev/null; then PM="uv pip"
elif command -v pip3 &>/dev/null; then PM="pip3"
else echo "ERROR: Neither uv nor pip3 found"; exit 1; fi
python3 -c "import plotext" 2>/dev/null || { echo "Installing plotext via $PM..."; $PM install plotext; }
python3 -c "
import plotext as plt, re
plt.clear_figure()
plt.plot([1,2,3], [1,2,3], marker='dot')
plt.plotsize(20, 5)
plt.theme('clear')
output = re.sub(r'\x1b\[[0-9;]*m', '', plt.build())
assert '•' in output
" && echo "✓ plotext ready (dot marker verified)"
PREFLIGHT_EOF
```

## Quick Start

```python
import re
import plotext as plt

x = list(range(20))
y = [97, 98, 100, 101, 100, 98, 100, 101, 102, 101,
     100, 98, 100, 101, 102, 103, 102, 101, 100, 100]

plt.clear_figure()
plt.plot(x, y, marker="dot", label="Price path")
plt.hline(103)    # Upper barrier
plt.hline(97)     # Lower barrier
plt.hline(100)    # Entry price
plt.title("Triple Barrier Method")
plt.xlabel("Time (bars)")
plt.ylabel("Price")
plt.plotsize(65, 22)
plt.theme("clear")
print(re.sub(r'\x1b\[[0-9;]*m', '', plt.build()))
```

## Mandatory Settings

Every chart MUST use these settings:

| Setting         | Code                        | Why                          |
| --------------- | --------------------------- | ---------------------------- |
| Reset state     | `plt.clear_figure()`        | Prevent stale data           |
| Dot marker      | `marker="dot"`              | GitHub-safe alignment        |
| No color        | `plt.theme("clear")`        | Clean text output            |
| Strip ANSI      | `re.sub(r'\x1b\[…', '', …)` | Remove residual escape codes |
| Build as string | `plt.build()`               | Not `plt.show()`             |

## Marker Reference

| Marker      | GitHub Safe | Use When                       |
| ----------- | ----------- | ------------------------------ |
| `"dot"`     | Yes         | **Default — always use**       |
| `"hd"`      | Yes         | Terminal-only, need smoothness |
| `"braille"` | No          | Never for markdown             |
| `"fhd"`     | No          | Never — Unicode 13.0+ only     |

## Rendering Command

```bash
/usr/bin/env bash << 'RENDER_EOF'
python3 << 'CHART_EOF'
import re
import plotext as plt

x = list(range(20))
y = [97, 98, 100, 101, 100, 98, 100, 101, 102, 101,
     100, 98, 100, 101, 102, 103, 102, 101, 100, 100]

plt.clear_figure()
plt.plot(x, y, marker="dot", label="Price path")
plt.hline(103)
plt.hline(97)
plt.hline(100)
plt.title("Triple Barrier Method")
plt.xlabel("Time (bars)")
plt.ylabel("Price")
plt.plotsize(65, 22)
plt.theme("clear")
print(re.sub(r'\x1b\[[0-9;]*m', '', plt.build()))
CHART_EOF
RENDER_EOF
```

## Embedding in Markdown (MANDATORY: Source Adjacent to Chart)

Every chart MUST be **immediately followed** by a `<details>` block with Python source. Explanatory text goes **after** the `<details>` block, never between chart and source.

```
✅ CORRECT: Chart → <details> → Explanatory text
❌ WRONG:   Chart → Explanatory text → <details>
```

See [./references/api-and-patterns.md](./references/api-and-patterns.md) for full embedding template.

## Mandatory Checklist

- [ ] `plt.clear_figure()` — Reset state
- [ ] `marker="dot"` — Dot marker for GitHub
- [ ] `plt.theme("clear")` + `re.sub()` strip — No ANSI codes
- [ ] `plt.title("...")` — Every chart needs a title
- [ ] `plt.xlabel` / `plt.ylabel` — Axis labels
- [ ] `plt.plotsize(65, 22)` — Fits 80-col code blocks
- [ ] `<details>` block **immediately after** chart (before any explanatory text)

## Troubleshooting

| Issue                 | Cause               | Solution                                      |
| --------------------- | ------------------- | --------------------------------------------- |
| ANSI codes in output  | Missing theme/strip | Add `plt.theme("clear")` and `re.sub()` strip |
| Misaligned on GitHub  | Wrong marker type   | Use `marker="dot"`, never braille/fhd         |
| Chart too wide        | plotsize too large  | Use `plt.plotsize(65, 22)` for 80-col blocks  |
| No diagonal slopes    | Too few data points | Use 15+ data points for visible slopes        |
| `ModuleNotFoundError` | Not installed       | Run preflight check                           |
| Empty output          | Missing `build()`   | Use `plt.build()` not `plt.show()`            |

## Resources

- [plotext GitHub](https://github.com/piccolomo/plotext)
- [Full API, patterns, and embedding guide](./references/api-and-patterns.md)
- [Tool selection rationale](./references/tool-selection.md)

## Post-Execution Reflection

After this skill completes, check before closing:

1. **Did the command succeed?** — If not, fix the instruction or error table that caused the failure.
2. **Did parameters or output change?** — If the underlying tool's interface drifted, update Usage examples and Parameters table to match.
3. **Was a workaround needed?** — If you had to improvise (different flags, extra steps), update this SKILL.md so the next invocation doesn't need the same workaround.

Only update if the issue is real and reproducible — not speculative.

© terrylica · MIT · terrylica/cc-skills

Similar skills

All skills for Writing and docs →

From the same set79

The whole set →
documentation-standards documentation-standards defines Markdown guidelines tailored for LLM parsing and clean Pandoc PDF export. It stops broken section numbering and unstructured doc sprawl. CX Codex +1 161installs imessage-query imessage-query pulls conversations out of ~/Library/Messages/chat.db with SQLite, searches across chats, and recovers text from binary attributedBody blobs. CX Codex +1 159installs clickhouse-architect clickhouse-architect designs ClickHouse v24.4+ table schemas, selects compression codecs, and configures sorting keys for cloud and self-hosted clusters. CX Codex +1 157installs dead-code-detector dead-code-detector finds unreachable code, unused imports, and dead exports across Python, TypeScript, and Rust codebases. Useful before major releases and refactoring sprints. CX Codex +1 150installs latex-setup The latex-setup skill sets up and verifies LaTeX on macOS, then configures Skim and SyncTeX. It supports Mac preparation and TeX package troubleshooting. CX Codex +1 146installs adaptive-wfo-epoch adaptive-wfo-epoch sets how many epochs to train on each walk-forward fold, ranking candidates by walk-forward efficiency rather than one fixed number for the whole run. CX Codex +1 146installs log-reader log-reader reads MetaTrader 5 log files and Print() output straight from UTF-16LE daily logs without checking the Experts tab manually. CX Codex +1 145installs adr-code-traceability The adr-code-traceability skill links code to Architecture Decision Records with file headers or inline comments. Use it when an implementation choice needs a clear connection to its decision record. CX Codex +1 144installs

Project sponsors

Companies that keep this analytics open