A Pillow extension for drawing graphs and charts.
Project description
piligraphs
A Pillow extension for drawing graphs and charts.
Installation
To install this module, run the following command:
pip install piligraphs
Example usage
Creating a line chart:
import random
from piligraphs import LineChart, Node
# define nodes
nodes = [
Node(weight=random.randint(1, 7)) for _ in range(10)
]
# create a line chart
chart = LineChart(
size=(1200, 300),
thickness=8,
fill=(243, 14, 95, 156),
outline=(194, 43, 132, 256),
pwidth=15,
onlysrc=True,
npoints=len(nodes) * 8,
interp='cubic'
)
# add nodes
chart.add_nodes(*nodes)
# draw the graph
image = chart.draw()
image.show()
Result:
You can find more examples here.
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
piligraphs-0.0.7.tar.gz
(11.2 kB
view hashes)
Built Distribution
piligraphs-0.0.7-py3-none-any.whl
(19.7 kB
view hashes)
Close
Hashes for piligraphs-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98b7a3372aa9a8f123fe9cf634922ab9745f4307abcdae2a352a09d630d7b551 |
|
MD5 | 8a887de0ba9e0e0ea95d02dcd57ce4d4 |
|
BLAKE2b-256 | 92c633dae5fbb525b09731fe4a04a30b32f13f8809a826ba52cf11a4920d89da |