From: richard.jones@fulcrum.com.au (Richard Jones)
Subject: ANN: PILGraph 0.1 alpha release 1
Date: Wed, 17 Mar 1999 05:19:36 GMT
I'm happy to announce the first release of my PIL-generation simple graphing
/ plotting module. This module is being developed as a replacement for the
graphing module supplied with the httpd_log tool. I've been meaning to write
this for a very, very long time :)
I'd like to invite all interested people to download the module, give it a
test run and maybe give me some feedback on the inner and outer workings. It's
alpha-stage software and I'm not afraid to change the API or even internal
structure if I'm given good enough reasons.
From the docstring:
'''
This module defines several top-level components:
LineGraph - draws datasets with a line between the datapoints
XTicks - decoration that gives regular tick-marks for X axis
XTickValues - adds display of tick-mark values to XTicks
YTicks - same as XTicks but for Y axis
YTickValues - adds display of tick-mark values to YTicks
FloatValues - floating-point number renderer for TickValues classes
ByteValues - byte number renderer for TickValues classes
MonthValues - month of year renderer for TickValues classes
DateValues - day and month of year renderer for TickValues classes
Sample usage:
>>> from PILGraph import *
>>> graph = LineGraph('P', (400,200), 0)
>>> x = range(11)
>>> y = [3.5,3,1,3,25,10,6,7,8,9,13]
>>> graph.add_dataset('test', x, y)
>>> y = [3.5,3,-1,3,22,10,6,7,8,9,13]
>>> graph.add_dataset('test2', x, y)
>>> graph.add_decoration(XTickValues(FloatValues(), mod_steps=1))
>>> graph.add_decoration(XLabel('Test Time Scale'))
>>> graph.add_decoration(YTickValues(ByteValues(align='right'), mod_steps=1))
>>> graph.add_decoration(YLabel('Test Foo Scale (bytes)'))
>>> graph.render()
>>> graph.image.show()
>>>
'''
Note that MonthValues and DateValues are mostly useless at the moment
because I haven't implemented a tickmark placement algorithm for date ranges
yet. I'm open to suggestions ;)
The place to get it is:
http://redback.spyda.net/~richard/PILGraph-0.1a1.tar.gz
You'll need to get PIL 1.0b1 from:
http://www.pythonware.com/
Richard