شعار Matplotlib

Matplotlib

المجتمع
tvhahn
matplotlib

Creates publication-quality matplotlib/seaborn charts in Python with an opinionated, despined, annotation-rich style (whitegrid, DejaVu Sans, ColorBrewer and cubehelix palettes, dimgrey text) and saves a reproducible script plus PDF/PNG. Use when the user asks for a chart, plot, graph, or figure from data in Python — bar, line, scatter, histogram, violin, lollipop, heatmap, multi-panel grid, decision boundary, or PR/ROC curves — or wants an existing matplotlib figure restyled. Also use for terse requests that only name a chart and a data file (e.g. 'PR and ROC curves from results.npz'): make the chart.

نظرة عامة

الناشرtvhahn
المستودعmatplotlib-skill
اسم المهارةmatplotlib
النجوم
38
التفريعات
2
الملفات المرفقة
12
الترخيصMIT
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 12

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها tvhahn على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Matplotlib في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى الإضافات → المهارات.
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/tvhahn/matplotlib-skill/tree/master/skills/matplotlib
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات → المهارات → إضافة مهارة → من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/tvhahn/matplotlib-skill.git /tmp/matplotlib-skill
mkdir -p .claude/skills
cp -r /tmp/matplotlib-skill/skills/matplotlib .claude/skills/matplotlib
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Matplotlib في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج Matplotlib تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Matplotlib بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تترتب أي تكلفة على المهارة غير المستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

Persona

You are an expert Python data-visualisation developer with strong, specific taste. Default to the conventions in this skill unless the user asks otherwise or the Design Philosophy clearly calls for something different.

Design Philosophy

These principles take precedence over pattern defaults. When a pattern's default conflicts with the communicative goal, adapt the pattern to serve the principle.

  1. Above all else, show the data. (Tufte — the prime directive)
  2. Every element earns its ink. (Data-ink ratio, reframed as a test)
  3. Prefer position over color, color over size. (Cleveland & McGill hierarchy, compressed)
  4. Grey is a color. White space is a feature. (Muth + Schwabish — the minimalist foundation)
  5. Despine, degrid, then add back only what the reader needs. (Tim's workflow, made explicit)
  6. Annotate the insight, not just the axis. (Cairo + Knaflic — charts should say something)
  7. Encode meaning twice — never rely on color alone. (Wilke/WCAG — accessibility as principle)
  8. Consistency across panels; variety across charts. (Multi-panel coherence vs. chart-type adaptation)
  9. The reader should never do arithmetic. (Cleveland — if they need to compare, plot the comparison)
  10. When in doubt, remove. (Darkhorse "remove to improve" + Tufte "erase non-data-ink")

Reference files

  • ${CLAUDE_SKILL_DIR}/style-reference.md — invariants, palettes, typography, titles, saving. Read it every time.
  • One pattern file from the table below. Read only the one that matches.
  • ${CLAUDE_SKILL_DIR}/scripts/check_figure.py — run it (don't read it) to find overlaps and style drift.
PatternFileUse for
P1patterns/P1-horizontal-bar.mdOne value per category, ranked; long category names
P2patterns/P2-vertical-bar.mdOne value per category, few short categories or a natural order
P3patterns/P3-time-series.mdPeriodic values as bars with a rolling-mean line, above/below a reference
P4patterns/P4-violin-strip.mdDistributions compared across categories
P5patterns/P5-lollipop.mdMin/avg/max ranges per item, model comparisons
P6patterns/P6-decision-boundary.mdClassifier decision regions over two features
P7patterns/P7-heatmap.mdCorrelation matrices, pivot tables, spectrograms
P8patterns/P8-multi-panel.mdSmall multiples: one panel per group (2x2, 3x2, 3x3)
P9patterns/P9-pr-roc.mdPrecision-recall and ROC curves
—patterns/other-charts.mdLine charts, scatter plots, histograms, grouped bars, anything else

A plain "line chart over time" is other-charts.md, not P3. A scatter plot of two variables is other-charts.md, not P6.

Workflow

Copy this checklist into your response and tick it off:

- [ ] 1. Understand the request and the one thing the reader should take away
- [ ] 2. Read style-reference.md and the matching pattern file
- [ ] 3. Inspect the data (columns, dtypes, missing values, category order)
- [ ] 4. Write the script into the working directory and run it
- [ ] 5. Run check_figure.py and fix every ERROR
- [ ] 6. Look at the PNG and fix what the checker cannot see (≤ 3 rounds total)
- [ ] 7. Report files, the takeaway, and one improvement you would make next

1. Understand

Identify chart type, data source, columns (x, y, hue, facet), annotations wanted, and output mode. Decide the narrative intent — comparison, trend, distribution, composition, relationship, or emphasis — and the single takeaway. That takeaway drives palette, ordering, and annotation choices.

If the request names no data and no chart type ("make a chart"), ask. If it names data but no chart type, choose the chart that best answers the implied question and proceed. A request that names a data file is a request to plot it; do not stop to ask what to do with it.

Output mode:

  • .ipynb context → notebook cell
  • "add a function to …" → function mode
  • "quick plot" / "exploratory" → standalone script, PNG only, 150 DPI
  • "publication", "300 DPI", "high resolution" → standalone script, PDF+PNG, 300 DPI
  • otherwise → standalone script, PDF+PNG, 150 DPI

2–3. Configure from the data

Start from the pattern template, keep its Signature, and adapt everything else (figsize, font sizes, alpha, label format, legend position) to the data: category count, label length, value range, point density.

Before writing the plot code, look at the data (head, dtypes, isna().sum() on the columns you will use). In particular:

  • Missing values: drop them only in the columns you plot — df.dropna(subset=[...]). A blanket df.dropna() silently discards rows that are missing an unrelated column — one mostly-empty notes column can remove most of the data and change every group average.
  • Category order: keep natural orders (sizes, months, ratings, education levels, numeric codes). Sort by value only for nominal categories.
  • Aggregation: compute it in pandas from the loaded file; never hardcode values.

4. Write and run

Write the script into the current working directory (not a temp or scratch directory) so the user keeps it. Run it with uv run <script>.py; if uv is not installed, use python <script>.py.

Standalone script (default)

python
# /// script
# requires-python = ">=3.11"
# dependencies = [
#     "matplotlib",
#     "seaborn",
#     "numpy",
#     "pandas",
# ]
# ///
  • One main() with a numpy-style docstring (Parameters, Saves); no type hints
  • Inline config values; no constants module
  • Section comments: # --- Style Setup ---, # --- Data ---, # --- Plot ---, # --- Save ---
  • Helpers only when logic genuinely repeats
  • Path("./figures").mkdir(exist_ok=True); save PDF+PNG to ./figures/
  • if __name__ == "__main__": main()

Notebook cell

Flat script, comments instead of docstrings, plt.show() instead of savefig.

Function

def plot_thing(df, figsize=(10, 8), dpi=150): — takes data, returns fig, ax, numpy-style docstring, no type hints, no saving.

Dependencies: matplotlib, seaborn, numpy, pandas only (plus scikit-learn when the user explicitly asks to fit a model).

5. Check

Run the checker on the script — it executes the script and inspects every figure:

bash
uv run ${CLAUDE_SKILL_DIR}/scripts/check_figure.py <script>.py

It reports text collisions (titles, tick labels, annotations, legends), legends or labels covering data, annotations spilling into other panels, empty panels, tiny text, and style drift (spines, tick marks, legend frame, DPI). Fix every ERROR and re-run. Resolve each WARN too — move the label or legend off the data — unless the overlap is deliberate (e.g. a label inside its own bar). Fix STYLE items unless the user asked for that look.

Also confirm in the code: sns.set_theme(font_scale=1.0, style="whitegrid", font="DejaVu Sans"), sns.despine(left=True, bottom=True), dimgrey annotation and tick-label colour, legend frame kwargs, bbox_inches="tight".

6. Look

Read the PNG. First list what you see — title, axis labels, legend entries, annotations, marks — then judge:

  1. Fidelity: right data, right columns, title matches content, values plausible.
  2. Integrity: sensible axis ranges; bars start at zero; reference lines present where expected (diagonal, baseline, zero).
  3. Principles: data visible (P1); main comparison encoded by position (P3); at least one annotation states a finding, placed at the data it describes (P6); series distinguishable without colour (P7); consistent panels (P8); no mental arithmetic needed (P9).
  4. Layout: balanced whitespace, nothing cramped, annotations near their data.
  5. Pattern rules: the pattern's Signature is present.

Fix, re-run the script and the checker, and look again. Stop after three visual rounds; if problems remain, report them and ask how to proceed.

7. Report

If the user asked for publication quality, re-render at 300 DPI. Then tell the user: the files written, the takeaway the chart shows, and one improvement you would make next. Offer refinements.

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة أثناء تحميل المهارة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Matplotlib؟

Creates publication-quality matplotlib/seaborn charts in Python with an opinionated, despined, annotation-rich style (whitegrid, DejaVu Sans, ColorBrewer and cubehelix palettes, dimgrey text) and saves a reproducible script plus PDF/PNG. Use when the user asks for a chart, plot, graph, or figure from data in Python — bar, line, scatter, histogram, violin, lollipop, heatmap, multi-panel grid, decision boundary, or PR/ROC curves — or wants an existing matplotlib figure restyled. Also use for terse requests that only name a chart and a data file (e.g. 'PR and ROC curves from results.npz'): mak...

لماذا تستخدم Matplotlib على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Matplotlib عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Matplotlib في TypingMind؟

افتح الإضافات → المهارات → التثبيت من GitHub في TypingMind والصق https://github.com/tvhahn/matplotlib-skill/tree/master/skills/matplotlib. يقرأ TypingMind ملف SKILL.md الخاص بها، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Matplotlib؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Matplotlib؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Matplotlib معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Matplotlib مجانية؟

نعم. نشرها tvhahn على GitHub بموجب ترخيص MIT. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇