How can I save a plot in python using matplotlib?
Question: When using:

    
    
    In [42]: tz_counts[:10].plot(kind='barh', rot=0)
    

it return:

    
    
    Out[42]: <matplotlib.axes._subplots.AxesSubplot at 0x7fa216b464d0>
    

But I can't see any file, it isn't showing either.

I start learning python today. Can someone help me?


Answer: You can use
[savefig](http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.savefig):

    
    
    import matplotlib.pyplot as plt
    plt.plot(range(10), range(10))
    plt.savefig('a.pdf')
    

