"title": "Another phase-progressing wave" }) thread1.start() if __name__ == "__main__": # Parse the options plplot_py_demos.plparseopts(sys.argv, plplot_py_demos.PL_PARSE_FULL) # Initialize gtk.gdk.threads_init() # Create the first canvas, set its size, draw some axes on it, and # place it in a frame canvas0 = plplotcanvas.Canvas() canvas0.set_size(WIDTH, HEIGHT) canvas0.adv(0) # Advance the page to finalize the plot setup_plot(canvas0, "A phase-progressing wave") canvas0frame = gtk.Frame() canvas0frame.set_shadow_type(type=gtk.SHADOW_ETCHED_OUT) canvas0frame.add(canvas0) # Create the second canvas, set its size, draw some axes on it, and # place it in a frame canvas1 = plplotcanvas.Canvas() canvas1.set_size(WIDTH, HEIGHT) canvas1.adv(0) # Advance the page to finalize the plot setup_plot(canvas1, "Another phase-progressing wave") canvas1frame = gtk.Frame() canvas1frame.set_shadow_type(type=gtk.SHADOW_ETCHED_OUT)
# Destroy event calback def destroy(widget, data=None): gtk.main_quit() # Parse the options plplot_py_demos.plparseopts(sys.argv, plplot_py_demos.PL_PARSE_FULL) # The data to plot x = plplot_py_demos.arange(11) y = x**2 / 10. # Create the canvas and set its size; during the creation process, # the gcw driver is loaded into plplot, and plinit() is invoked. canvas = plplotcanvas.Canvas() canvas.set_size(WIDTH, HEIGHT) # Create a new window and stuff the canvas into it window = gtk.Window(gtk.WINDOW_TOPLEVEL) window.set_border_width(10) window.add(canvas) # Connect the signal handlers to the window decorations window.connect("delete_event", delete_event) window.connect("destroy", destroy) # Display everything window.show_all() # Draw on the canvas with Plplot
plot_thread, kwargs={ "canvas": canvas1, "title": "Another phase-progressing wave" }) thread1.start() if __name__ == "__main__": # Initialize gtk.threads_init() # Create the first canvas, set its size, draw some axes on it, and # place it in a frame canvas0 = plplotcanvas.Canvas(aa=False) canvas0.use_fast_rendering(True) canvas0.set_aspect(ASPECT) canvas0.set_zoom(ZOOM) canvas0.pladv(0) # Advance the page setup_axes(canvas0, "A phase-progressing wave") canvas0frame = gtk.Frame() canvas0frame.set_shadow_type(type=gtk.SHADOW_ETCHED_OUT) canvas0frame.add(canvas0) # Create the second canvas, set its size, draw some axes on it, and # place it in a frame canvas1 = plplotcanvas.Canvas(aa=False) canvas1.use_fast_rendering(True) canvas1.set_aspect(ASPECT) canvas1.set_zoom(ZOOM)