Created
August 4, 2010 12:54
-
-
Save odebeir/508082 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from enthought.enable.api import ComponentEditor, BaseTool | |
from enthought.chaco.api import ArrayPlotData, Plot, jet, gray, PlotGraphicsContext | |
from enthought.traits.api import HasTraits, Instance, Enum, Range, Dict, Button, Int, Bool, Str, Property,Event, Array, DelegatesTo, on_trait_change,List, Tuple | |
from enthought.traits.ui.api import Item, Group, View, InstanceEditor | |
def draw_plot(filename, container,size=(800,600)): | |
"""Render a plot to file""" | |
container.outer_bounds = list(size) | |
container.do_layout(force=True) | |
gc = PlotGraphicsContext(size, dpi=150) | |
gc.render_component(container) | |
gc.save(filename) | |
return | |
if __name__ == '__main__': | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment