def save_cairo(fname, gbox, dpi): global wid, hgt wid = int(frm.get_pdom_wid() * dpi) hgt = int(frm.get_pdom_hgt() * dpi) dev_img = DeviceCairo(fname, gbox, dpi) dev_img.fill_black() dev_img.set_plot(frm) julia(dev_img) #dev_img.set_pixel(100,100, (255,0,0)) #dev_img.set_pixel(102,100, (0,255,0)) #dev_img.set_pixel(104,100, (0,0,255)) dev_img.close()
def save_cairo(fname, gbox, dpi): global dev_ani, movie movie = False dev_img = DeviceCairo(fname, gbox, dpi) dev_img.fill_black() dev_img.set_plot(frm_x2) run_rand_tree(dev_img) if movie: print(len(clips)) dev_ani = DeviceCairoAnimation("ftree2.mp4", dev_img, 0,0) video = concatenate_videoclips(clips, method='compose') #video.write_videofile("ftree01.mp4", fps=30) video.write_gif("ftree2.gif", fps=30) dev_img.close()
def main(): data = Data(-3, 3, -1, 10) fmm = FrameManager() frm_x2 = fmm.create(0.0, 0.0, 2, 4, data) gbbox = fmm.get_gbbox() dev_wmf = DeviceWindowsMetafile("patlin.wmf", gbbox) dev_wmf.set_device(frm_x2) test(dev_wmf) dev_wmf.close() dev_img = DeviceCairo("patlin.png", gbbox, dpi) dev_img.fill_white() dev_img.set_plot(frm_x2) test(dev_img) dev_img.close()
def main(): from vgl import color, BBox, Frame, FrameManager, Data from vgl import DeviceWindowsMetafile, DeviceCairo #from vgl import drawfrm, symbol, drawtick, drawaxis, drawlabel data = Data(-3, 3, -1, 10) fmm = FrameManager() frm_x2 = fmm.create(0.0, 0.0, 4, 4, data) gbbox = fmm.get_gbbox() dev_img = DeviceCairo("patlin.png", gbbox, 100) dev_img.fill_white() dev_img.set_plot(frm_x2) test(dev_img) dev_img.close() dev_wmf = DeviceWindowsMetafile("patlin.wmf", gbbox) dev_wmf.set_device(frm_x2) test(dev_wmf) dev_wmf.close()
def save_cairo(fname, frm, gbox, dpi): dev_img = DeviceCairo(fname, gbox, dpi) dev_img.fill_white() dev_img.set_plot(frm) plot_geom(dev_img) dev_img.close()
def save_img(fname, gbox, dpi): dev_img = DeviceCairo(fname, gbox, dpi) dev_img.fill_white() plot_all(dev_img) dev_img.close()