In [10]:
import matplotlib.pyplot as plt
import prettyplotlib as ppl
def plot_maker():
    def make_plot(data,i):
        fig,ax = plt.subplots(1)
        ppl.plot(ax,data,data)
        ax.set_xlim([0,10])
        ax.set_ylim([0,10])
        fig.savefig('num%d.png'%i, format = 'png')
    i = 0
    while i<10:
        make_plot(range(i), i)
        i+=1
        print(i)

In [11]:
plot_maker()


/usr/local/lib/python3.4/dist-packages/matplotlib/pyplot.py:516: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
  max_open_warning, RuntimeWarning)
/usr/local/lib/python3.4/dist-packages/matplotlib/__init__.py:872: UserWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter.
  warnings.warn(self.msg_depr % (key, alt_key))

In [ ]:
import matplotlib.pyplot as plt

sizes = [90, 10]
colors = ['#F05F40', '#252525']
explode = (0, 0, 0, 0)  # explode a slice if required

plt.pie(sizes, colors=colors)
        
#draw a circle at the center of pie to make it look like a donut
centre_circle = plt.Circle((0,0),0.75,color='black', fc='white',linewidth=1.25)
fig = plt.gcf()
fig.gca().add_artist(centre_circle)


# Set aspect ratio to be equal so that pie is drawn as a circle.
plt.axis('equal')
plt.show()