I have something like the following dataframe where each record is a point along a line. Fields include distance from the line's beginning and point elevation.
>>> import pandas as pd
>>> import matplotlib.pyplot as plt
>>>
>>> df=pd.DataFrame()
>>> df['Distance']=[5,100,200,300,350,370,400]
>>> df['Elevation']=[0,5,10,5,10,15,20]
>>> df
Distance Elevation
0 5 0
1 100 5
2 200 10
3 300 5
4 350 10
5 370 15
6 400 20
>>>
I want to create a plot that shows the elevation profile. Both distance and elevation are scaled in feet and I want it so increments of x and y have the same length (so the plot more realistically shows the elevation profile).
>>> plt.plot(df['Distance'],df['Elevation'])
[<matplotlib.lines.Line2D object at 0x0A1C7EB0>]
>>> plt.axis('equal')
(0.0, 400.0, 0.0, 20.0)
>>> plt.show()
>>>
Now that scaling is correct (a foot is represented by the same distance in both the x and y axis) how can I set the y limits so that they better suit the data (from -5 to 25 for example)?

