0

I've searched all over for the answers but couldn't find it for the life of me. Is there a way to make the line of a plot in pyplot actually hit the border of the plot, so that you can tell, which value your plot has at x=0 or y=0. And if you can, can you also add a marker at that location to signify the value?

Thanks for taking the time out of your day to answer!

Regards, Eric.

  • In [this post](https://stackoverflow.com/questions/43930954/plot-markers-on-curve-where-value-of-x-is-known-in-matplotlib) but using y instead of x. Also, check out [this other post](https://stackoverflow.com/questions/46909373/how-to-find-the-exact-intersection-of-a-curve-as-np-array-with-y-0). – JohanC Apr 23 '20 at 16:10
  • To don't have padding between the border and the curve, there is `plt.autoscale(enable=True, axis='y', tight=True)` which automatically sets the ylims (similar for ´x' or for 'both'). – JohanC Apr 23 '20 at 16:15

1 Answers1

0

Have you tried the following lines ?

plt.xlim((0, value_x_you_want))
plt.ylim((0, value_y_you_want))
Skryge
  • 81
  • 1
  • 9