matplotlib - Python & Matplot: how to set auto-offset? -
for example, when try plot points
points = [(0,0),(0,1),(1,1,),(1,0)] point in points: plt.plot(point[0], point[1], 'o') plt.show() it display

this makes points hard see. how can make x, y axis wider point move center of plot? like

that is, how can set offset value of points bounderies of plot, won't displaed @ corners?
points = [(0,0),(0,1),(1,1,),(1,0)] point in points: plt.plot(point[0], point[1], 'o') automin, automax = plt.xlim() plt.xlim(automin-0.5, automax+0.5) automin, automax = plt.ylim() plt.ylim(automin-0.5, automax+0.5) plt.show() if need set limits before plot data can turn off autoscaling first , set limits xlim , ylim
Comments
Post a Comment