sastraxi/cairoplot-bsm — Issue #1: Create cairoplot.book
Author: sastraxi
Created: 2011-10-09 08:00:09+00:00
State: open

Create a package that will let us make multi-page PDFs easily. Here's some envisioned stuff:

from cairoplot import VerticalBarPlot
from cairoplot.book import PDFBook, Inch, Page, GridPage

book = PDFBook(units=Inch)

page = GridPage(nx=1, ny=3, width=8.5, height=11.0, margin=0.5, spacing=0.5)
for space in page.spaces:
space.plot = VerticalBarPlot(data, space.width, space.height)
book.add(page)

page = GridPage(nx=1, ny=1, width=8.5, height=11.0, margin=3.0)
page.spaces[0].plot = ScatterPlot(data2, page.spaces[0].width, page.spaces[0].height)
book.add(page)

from cStringIO import StringIO
ss = StringIO()
book.save(ss)
book.save("example.pdf")