when plotting, matplotlib sets automatically the scales from the data content being plotted. But it seems the limits on both axes are always equal to the maxima from the data given to be plotted. It makes markers of data reaching maxima being copped. I would like to change this behaviour so that it leaves some space at the four sides of the plot whatever the marker size. At least, is there a way to simply set a static, user defined margin?
an example:
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(np.arange(10) ** 2, 's', ms = 20)
this example clearly shows 3 data points being cropped.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…