8

Using Sympy how does one set the range for the y axis ?

plot((x**2 + 2))

I wanted to have this so that the y axis would be from 0 to 7

baxx
  • 3,956
  • 6
  • 37
  • 75

1 Answers1

9

When you plot you can use the kwargs xlim and ylim to set the axis limits.

For example:

>>> plot((x**2 + 2), xlim=[-3,3], ylim=[0,7])

enter image description here

derricw
  • 6,757
  • 3
  • 30
  • 34
  • ah thats ace thanks, I tried to use them from the docs but didn't set them correctly, this works thanks – baxx Nov 23 '15 at 22:32
  • Is there a reason to use a mutable list for arguments when an immutable tuple is lighter for the CPU? – mins Sep 11 '22 at 11:07