~ubuntu-branches/ubuntu/vivid/python-chaco/vivid-proposed

« back to all changes in this revision

Viewing changes to examples/noninteractive.py

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2010-02-28 14:05:25 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100228140525-1eo43ddoakb2j3j9
Tags: 3.3.0-1
* New upstream release
* Switch to source format 3.0 (quilt)
* Bump Standards-Version to 3.8.4
* Remove transition package: python-enthought-chaco2

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
    gc.save(filename)
51
51
    return
52
52
 
 
53
def draw_svg(filename, size=(800,600)):
 
54
    from enthought.chaco.svg_graphics_context import SVGGraphicsContext
 
55
    container = create_plot()
 
56
    container.bounds = list(size)
 
57
    container.do_layout(force=True)
 
58
    gc = SVGGraphicsContext(size)
 
59
    gc.render_component(container)
 
60
    gc.save(filename)
 
61
 
53
62
def draw_pdf(filename, size=(800,600)):
54
63
    from enthought.chaco.pdf_graphics_context import PdfPlotGraphicsContext
55
64
    container = create_plot()
78
87
 
79
88
if __name__ == "__main__":
80
89
    draw_plot(get_directory('noninteractive.png'), size=(800, 600))
 
90
 
 
91
    # Render the plot as a SVG
 
92
    #draw_svg(get_directory('noninteractive.svg'), size=(800,600))
81
93
    
82
94
    # If you have ReportLab installed, you can uncomment the following:
83
95
    #draw_pdf(get_directory('noninteractive.pdf'))