I don't see the reason why, but the default behaviour of matplotlib plot is to have margins before and after the x-axis
Is there a way to fix this globally for all plots in my notebook?
I don't see the reason why, but the default behaviour of matplotlib plot is to have margins before and after the x-axis
Is there a way to fix this globally for all plots in my notebook?
Figured that out. Add this to the start of your page:
from pylab import rcParams
rcParams['axes.xmargin'] = 0
rcParams['axes.ymargin'] = 0
Apparently matplotlib default margins are set to 0.05:
#axes.xmargin : .05 # x margin. See `axes.Axes.margins`
#axes.ymargin : .05 # y margin. See `axes.Axes.margins`
So changing this value would globally change it for your plots.