Skip to main content

Kitty graphics protocol backend for matplotlib

Project description

kittyplot logo

kittyplot

Inline graphics backend for matplotlib. Renders plots directly in your terminal.

Supports the Kitty graphics protocol (Kitty, Ghostty, WezTerm) with automatic tmux passthrough.

Install

uv add kittyplot

Usage

Set the backend via MPLBACKEND environment variable or in code:

import matplotlib
matplotlib.use('module://kittyplot')
import matplotlib.pyplot as plt

plt.plot([1, 2, 3], [1, 4, 9])
plt.show()

Animation

Animations work automatically with FuncAnimation:

import matplotlib
matplotlib.use('module://kittyplot')
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
import numpy as np

x = np.linspace(0, 2 * np.pi, 100)
fig, ax = plt.subplots()
line, = ax.plot(x, np.sin(x))

def update(frame):
    line.set_ydata(np.sin(x + frame / 5.0))
    return line,

anim = FuncAnimation(fig, update, frames=200, interval=50, blit=False)
plt.show()

Press Ctrl-C to exit the animation. Set fig.canvas.fullscreen = True before creating the animation to use an alternate screen buffer.

tmux

Requires allow-passthrough in your tmux config:

set -g allow-passthrough on

Images use kitty virtual placements (unicode placeholders) so they anchor to the text buffer and scroll naturally within tmux panes.

Examples

Run with uv run:

uv run examples/simple.py
uv run examples/subplots.py
uv run examples/animation.py
uv run examples/lorenz.py
uv run examples/ggplot.py

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kittyplot-0.1.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kittyplot-0.1.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file kittyplot-0.1.0.tar.gz.

File metadata

  • Download URL: kittyplot-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kittyplot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2c5ba81247e6b40c79214dcba0853a89d1c7c209503c98db08ca30ee132d4c75
MD5 e93a2d65af04b871116fbcc83bf093ba
BLAKE2b-256 89b0e40742c4452cd65c21f2bd1d121a71859a0f37560d41c365431ef15b8744

See more details on using hashes here.

Provenance

The following attestation bundles were made for kittyplot-0.1.0.tar.gz:

Publisher: publish.yml on doug/kittyplot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kittyplot-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kittyplot-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kittyplot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ecd7179b559453a7dc4e60953f738fc2f393f237611d430c5be87ae747363de
MD5 7ed55ecb59fa9e419c51177d522fe291
BLAKE2b-256 1d9eb49ada96e2b6cef5d653335733b47f3afd170e351f1e5220b39a961b3c4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for kittyplot-0.1.0-py3-none-any.whl:

Publisher: publish.yml on doug/kittyplot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page