0

enter image description here![Left: Data from 2000-2040, Right: Data from 2001-2039][2]

Is there a way I can manually edit the bounds of my plot? When my x axis data runs from 2000 to 2040 matplotlib rearranges the plot such that a lot of white-space is produced on both the left and right sides of the plot, as in the left picture. However when I change my x axis data from 2001 to 2039 there is no whitespace as in the right picture. I suspect this happens because of how matplotlib automatically arranges the ticks. The question is how can the x-ticks be manipulated manually to avoid unnecessary whitespace? Any ideas?

Osmond Bishop
  • 7,560
  • 14
  • 42
  • 51

1 Answers1

2

You can use the various pyplot functions called xlim, ylim (to set the limits of the axes), xticks, yticks (to set the tick positions) etc. Read the documentation.

BrenBarn
  • 242,874
  • 37
  • 412
  • 384