python - Matplotlib Margins when plotting with Pandas -


i'm trying set margins points visible when plotting matplotlib doesn't seem correctly add them. below code , output.

i'm using ipython %matplotlib magic command.

is there i'm doing wrong?

import matplotlib.pyplot plt import pandas pd   d = pd.dataframe(pd.series(range(10))*2) = d.plot(style = "o-") a.set_axis_bgcolor('g')  a.margins(.05) 

matplotlib output

see following documentation set_ylim , set_xlim http://matplotlib.org/api/axes_api.html?highlight=set_xlim

d = pd.dataframe(pd.series(range(10))*2) = d.plot(style = "o-") a.set_axis_bgcolor('g') a.set_ylim([-1,19]) a.set_xlim([-1,11]) a.margins(.05) 

enter image description here


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

go - Idiomatic way to handle template errors in golang -