I'd like to specify the x limits of a sympy plot:
plot(normal(x=x,mean=10,sigma=5), (x, 0,20))
... but the is rendered with the x axis at y=0.5. What's up with that?
Full example:
%matplotlib inline
import sympy
from sympy import symbols
from sympy import plot
def normal(x, mean, sigma):
z = (x - mean) / sigma
return (1 / (sigma * sympy.sqrt(2 * sympy.pi))) * sympy.exp(-(z * z) / 2)
x = symbols("x")
p1 = plot(normal(x=x,mean=10,sigma=5), (x, 0,20),
# ylim=(0,1), xlim=(0,20) # No help
)
I found this (related) sympy.plotting.plot strange xlabel position but it refers to an older version of sympy.
