Skip to main content

ptoe (matPlotlib To ECharts)

ptoe is an experimental library that converts charts created with matplotlib 👉 into interactive HTML outputs powered by ECharts.

Core Philosophy

“Keep matplotlib syntax as-is, only change the output to ECharts.”

Supported Chart Types (v0.4.2)

Bar Chart

  • Single bar
  • Multiple series bar
  • Stacked bar (bottom=)
plt.bar(x, y1)
plt.bar(x, y2, bottom=y1)
ptoe.show()

*Automatically detects legend and stack *Supports category x-axis

Line Chart

  • Standard line
  • step line (plt.step, steps-pre/mid/post)
plt.plot(x, y)
plt.step(x, y, where="post")
ptoe.show()

*Automatically detects numeric / category x-axis *Converts step lines to ECharts step option

Scatter Plot

plt.scatter(x, y)
ptoe.show()

*matplotlib scatter → ECharts scatter

Area Chart

plt.fill_between

plt.fill_between(x, y)
ptoe.show()

*Detected via PolyCollection *Converted to ECharts line + areaStyle

Histogram

Directly computed using numpy.histogram()

ptoe.show(
    data=data,
    chart_type="hist",
    bins=30,
    density=False,
    cumulative=False,
    hist_range=[-3, 3],
    color="green",
    alpha=0.4,
    edgecolor="black",
)

Boxplot

Directly computed using original data

ptoe.show(
    data=data,
    chart_type="boxplot",
)

*Does NOT reuse matplotlib results *Quartiles and whiskers calculated manually *Can be used without matplotlib

Heatmap

ptoe.show(
    data=data,
    chart_type="heatmap",
)

*Uses 2D array directly *Automatically calculates min / max *Automatically generates visualMap *Can be used without matplotlib

Common Style Options

  • color
  • alpha
  • edgecolor
  • linewidth

Execution Modes

Convert matplotlib result

plt.plot(x, y)
ptoe.show()

Requires original data

ptoe.show(
    data=data,
    chart_type="hist",
)

*Recommended for hist / boxplot / heatmap

Running Methods

Jupyter / Colab

ptoe.show(inline=True)

Local (HTML)

ptoe.show()

Design Overview

  • Analyze matplotlib objects (wrap mode)
  • Automatic chart_type detection
  • Statistical charts computed from raw data
  • Generate ECharts options
  • Render HTML

Version History

v0.4.2

  • Transitioned to chart_type-based structure
  • Introduced raw data computation for hist, boxplot, heatmap
  • Partial style option support

One-Line Summary

ptoe is a tool for matplotlib users that delivers Same syntax, upgraded output.

Release files for ptoe 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ptoe 0.4.2
File Size Uploaded
ptoe-0.4.2.tar.gz 7.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ptoe 0.4.2
File Interpreter ABI Platform
ptoe-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 14.3 kB

Release files / ptoe-0.4.2.tar.gz

Download URL ptoe-0.4.2.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0fe0d1491152327c9d4939344cf29bf7695cc0c17015e0455ae32aa6b228d0ba
BLAKE2b-256 checksum
How to use checksums
ac22ae82ef437b9d1a66b881d7bdc9ea21e8033a6aad64c50b99f3379e2dece1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / ptoe-0.4.2-py3-none-any.whl

Download URL ptoe-0.4.2-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdd417d6dc974b14689d9fdefa31c6b49bd4cbfbe32e16334f4f6be8a26fbde3
BLAKE2b-256 checksum
How to use checksums
a5e6e2814b51f7565b45723786007f2c303606aae69c1b9e7c77aaa5ef6a79dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.0

2 release files

0.3.9

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page