Skip to main content

Plot multicolored lines in Matplotlib

Project description

Matplotlib Multicolored Line

CI Status Documentation Status Test coverage percentage

uv Ruff pre-commit

PyPI Version Supported Python versions License


Documentation: https://matplotlib-multicolored-line.readthedocs.io

Source Code: https://github.com/34j/matplotlib-multicolored-line


Plot multicolored lines in Matplotlib. Port of Multicolored lines — Matplotlib 3.10.1 documentation with slight improvements.

Installation

Install this via pip (or your favourite package manager):

pip install matplotlib-multicolored-line

Usage

import matplotlib.pyplot as plt
import numpy as np

from matplotlib_multicolored_line import colored_line


t = np.linspace(-7.4, -0.5, 200)
x = 0.9 * np.sin(t)
y = 0.9 * np.cos(1.6 * t)

fig, ax = plt.subplots()
lc = colored_line(x, y, c=t, ax=ax, linewidth=10)
fig.colorbar(lc)

Result

y = np.random.normal(size=(5, 2))
c = np.random.normal(size=(5, 2))

fig, ax = plt.subplots()
lc = colored_line(y, c=c, ax=ax, linewidth=10)
fig.colorbar(lc)

Result 2

Contributors ✨

Thanks goes to these wonderful people (emoji key):

34j
34j

💻 🤔 📖

This project follows the all-contributors specification. Contributions of any kind welcome!

Credits

Copier

This package was created with Copier and the browniebroke/pypackage-template project template.

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

matplotlib_multicolored_line-0.3.0.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

matplotlib_multicolored_line-0.3.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file matplotlib_multicolored_line-0.3.0.tar.gz.

File metadata

File hashes

Hashes for matplotlib_multicolored_line-0.3.0.tar.gz
Algorithm Hash digest
SHA256 30c96cf5537cf1344ea303fe6c40bdbaa5904e68ff30062e24be6ead4bd079c0
MD5 6f15c4053b828d981f13945b85ad1435
BLAKE2b-256 72fad2df19404da0b4593539b655fa22fb8be64112768df70c5d8afdd4bc6c52

See more details on using hashes here.

Provenance

The following attestation bundles were made for matplotlib_multicolored_line-0.3.0.tar.gz:

Publisher: ci.yml on 34j/matplotlib-multicolored-line

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

File details

Details for the file matplotlib_multicolored_line-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for matplotlib_multicolored_line-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 870e0ecc1b375fee274295b283bcf769d3feba61a8c326e2c9c529935b42117e
MD5 b7ba5e55dc6a0ddd61f79794d547e103
BLAKE2b-256 9ee62250f85c9bf04c755eca599094e8139949e154397d45affe44694b4307e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for matplotlib_multicolored_line-0.3.0-py3-none-any.whl:

Publisher: ci.yml on 34j/matplotlib-multicolored-line

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