Kitty graphics protocol backend for matplotlib
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c5ba81247e6b40c79214dcba0853a89d1c7c209503c98db08ca30ee132d4c75
|
|
| MD5 |
e93a2d65af04b871116fbcc83bf093ba
|
|
| BLAKE2b-256 |
89b0e40742c4452cd65c21f2bd1d121a71859a0f37560d41c365431ef15b8744
|
Provenance
The following attestation bundles were made for kittyplot-0.1.0.tar.gz:
Publisher:
publish.yml on doug/kittyplot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kittyplot-0.1.0.tar.gz -
Subject digest:
2c5ba81247e6b40c79214dcba0853a89d1c7c209503c98db08ca30ee132d4c75 - Sigstore transparency entry: 1481654005
- Sigstore integration time:
-
Permalink:
doug/kittyplot@97f5aa657d4c251732189e781ce0d64943646ead -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/doug
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@97f5aa657d4c251732189e781ce0d64943646ead -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ecd7179b559453a7dc4e60953f738fc2f393f237611d430c5be87ae747363de
|
|
| MD5 |
7ed55ecb59fa9e419c51177d522fe291
|
|
| BLAKE2b-256 |
1d9eb49ada96e2b6cef5d653335733b47f3afd170e351f1e5220b39a961b3c4e
|
Provenance
The following attestation bundles were made for kittyplot-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on doug/kittyplot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kittyplot-0.1.0-py3-none-any.whl -
Subject digest:
8ecd7179b559453a7dc4e60953f738fc2f393f237611d430c5be87ae747363de - Sigstore transparency entry: 1481654172
- Sigstore integration time:
-
Permalink:
doug/kittyplot@97f5aa657d4c251732189e781ce0d64943646ead -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/doug
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@97f5aa657d4c251732189e781ce0d64943646ead -
Trigger Event:
push
-
Statement type: