Sunday, January 3, 2016

Cartesius: Simple python coordinate system graphing library

Cartesius is a simple python library for writing coordinate system images. The main reason why I started it was that existing libraries depended on C/C++ modules which are not available on google appengine python SDK. Cartesius has only one dependency -- PIL.

Example usage:

import cartesius.main as cartesius
import cartesius.elements as elements
import cartesius.charts as charts

coordinate_system = cartesius.CoordinateSystem()

# list or tuple of two-element tuples (value, label):
piechart_data = ('abc', 1),'cde', 2),'efg', 4),'ijk', 1),'lmn', 5),'opq', 5),'xyz', 3),
piechart = charts.PieChart(data=piechart_data, color=(0, 0, 0))

# No need for axes:
coordinate_system.add(elements.Axis(horizontal=True, hide=True))
coordinate_system.add(elements.Axis(vertical=True, hide=True))
The result is:
More examples in the README.

No comments:

Post a Comment