Set autoscale limits on plot to have buffer around all points

前端 未结 2 1095
轻奢々
轻奢々 2020-12-31 13:58

I would like to plot a set of points using pyplot in matplotlib but have none of the points be on the edge of my axes. The autoscale (or something) sets the xlim

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-31 14:14

    A similar question was posed to the matplotlib-users list earlier this year. The most promising solution involves implementing a Locator (based on MaxNLocator in this case) to override MaxNLocator.view_limits.

提交回复
热议问题