Exemple #1
0
 def write_image(cls, filename, scene):
     code = scene_code(scene) + "\n\nplt.show()"
     with open(filename, "wt") as f:
         f.write(code)
Exemple #2
0
 def write_image(cls, filename, scene):
     import matplotlib
     with matplotlib.rc_context({"backend": "pdf"}):
         code = scene_code(scene) + "\n\nplt.savefig({})".format(
             repr(filename))
         exec(code, {})  # will generate a pdf
Exemple #3
0
 def write_image(cls, filename, scene):
     code = scene_code(scene) + "\n\nplt.savefig({})".format(repr(filename))
     exec(code, {})  # will generate a pdf