def make_fig():
 fig = Figure()
 ax = fig.add_subplot(1, 1, 1)
 ax.plot([1, 2, 3], 'ro--', markersize=12, markerfacecolor='g')
 x = np.random.rand(100)
 y = np.random.rand(100)
 area = (np.pi * ((10 * np.random.rand(100)) ** 2))
 c = ax.scatter(x, y, area)
 c.set_alpha(0.5)
 ax.set_title('My first image')
 ax.set_ylabel('Some numbers')
 ax.set_xticks((0.2, 0.4, 0.6, 0.8))
 labels = ax.set_xticklabels(('Bill', 'Fred', 'Ted', 'Ed'))
 for label in labels:
  label.set_rotation(45)
  label.set_fontsize(12)
 FigureCanvasAgg(fig).print_png('webapp.png', dpi=150)

def make_fig ( ) : fig = Figure ( ) ax = fig . add_subplot ( 1 , 1 , 1 ) ax . plot ( [ 1 , 2 , 3 ] , 'ro--' , markersize = 12 , markerfacecolor = 'g' ) x = np . random . rand ( 100 ) y = np . random . rand ( 100 ) area = ( np . pi * ( ( 10 * np . random . rand ( 100 ) ) ** 2 ) ) c = ax . scatter ( x , y , area ) c . set_alpha ( 0.5 ) ax . set_title ( 'My first image' ) ax . set_ylabel ( 'Some numbers' ) ax . set_xticks ( ( 0.2 , 0.4 , 0.6 , 0.8 ) ) labels = ax . set_xticklabels ( ( 'Bill' , 'Fred' , 'Ted' , 'Ed' ) ) for label in labels : label . set_rotation ( 45 ) label . set_fontsize ( 12 ) FigureCanvasAgg ( fig ) . print_png ( 'webapp.png' , dpi = 150 )
make a figure and save it to "webagg .