Skip to content

A Python Pillow extension for drawing graphs and charts.

License

Notifications You must be signed in to change notification settings

eeemoon/piligraphs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

piligraphs

pypi python CodeFactor BuyMeACoffee

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.

Releases

No releases published

Packages

No packages published

Languages