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)
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)
Comments
Post a Comment