Pandas and matplotlib doing linear graph
Question: Any idea whats missing in my code to avoid part of the graph/canvas and dates
being out of the PNG image? Is it possible to have the dates written in 180
degrees or in vertical to not use so much space of the grapth?

My data set is:

    
    
    15/03/16    3000    300 200
    12/04/16    3000    300 300
    10/05/16    500 500 400
    12/06/16    1000    600 500
    14/07/16    1250    300 500
    21/07/16    2000    300 50
    15/08/16    3000    300 200
    12/09/16    3000    300 300
    10/10/16    500 500 400
    12/11/16    1000    600 500
    15/11/16    1250    300 500
    21/12/16    1000    500 50
    

Python code is:

    
    
    import pandas
    import matplotlib.pyplot as plt
    
    df = pandas.read_csv('data.csv', delimiter=';', 
                         index_col=0, 
                         parse_dates=[0], dayfirst=True, 
                         names=['date','a','b','c'])
    df.plot()
    df.plot(subplots=True, figsize=(6, 6))
    
    plt.savefig('sampledata1.png')
    

And png looks like (missing data):

[![enter image description
here](http://i.stack.imgur.com/Bom4X.png)](http://i.stack.imgur.com/Bom4X.png)

Thank you!


Answer: The data is there, it is just being plotted on the edge of the plot. You can
change the y-limits globally with

    
    
    df.plot(ylim=(0,3500))
    df.plot(subplots=True, figsize=(6, 6), ylim=(0,3500))
    

To change them for each plot, I think you'll need to plot the curves
individually.

To do it individually, I typically do something like this (there are a zillion
ways do it):

    
    
    fig, axes = plt.subplots(3,1)
    axes[0].set_ylim([df.a.min()*0.9, df.a.max()*1.1])
    axes[0].set_xticklabels([])
    axes[1].set_ylim([df.b.min()*0.9, df.b.max()*1.1])
    axes[1].set_xticklabels([])
    axes[2].set_ylim([df.c.min()*0.9, df.c.max()*1.1])
    axes[0].plot(df.a)
    axes[1].plot(df.b)
    axes[2].plot(df.c)
    

[![jupyter
screenshot](http://i.stack.imgur.com/l2LJW.jpg)](http://i.stack.imgur.com/l2LJW.jpg)

The axis labels can be adjusted to be readable, etc. - checkout matplotlib.org
for lots of examples.

