0

I created a simple Python 3.X script with Matplotlib which creates a linear function and draws it to the figure.

So far I just couldn't figure out how to remove the white space / offset between the y-Axis and the lines / plots from the figure window.

See this simple example. The red arrow points down to the giant space between the beginning of the lines and the y-Axis.

OFFSET EXAMPLE

1 Answers1

0

You can specify the max limit of y axis by adding

plt.ylim(0, 8)
Xiaoyu Lu
  • 3,280
  • 1
  • 22
  • 34
  • worked but now the x-axis goes to 400 but in 50-steps -> 0 - 50 - 100 - 150 ... How can I change that, it worked with xticks but that one causes the offset issue. –  Jan 05 '19 at 21:01
  • the question marked by @ImportanceOfBeingErnest has all the answer you need to solve the offset and x&y label issues. I recommend everyone to check that one's answer out! –  Jan 06 '19 at 17:13