y limit matplotlib code example Example 1: ylim python plt.ylim([a,b]) Example 2: limit axis matplotlib plt.xlim(0, 100)