Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect plot of exponential expression #18920

Open
Smit-create opened this issue Mar 21, 2020 · 2 comments
Open

Incorrect plot of exponential expression #18920

Smit-create opened this issue Mar 21, 2020 · 2 comments
Labels

Comments

@Smit-create
Copy link
Member

While trying to add a plotting feature for the stats module, I found the following issue with plotting.

>>> from sympy.stats import *
>>> from sympy.abc import x
>>> X = Exponential('X', 300)
>>> density(X)(x)
300*exp(-300*x)

While plotting the density(X)(x), I got the following plot(in the below attached screenshot)
IMG_20200321_160059

@smichr
Copy link
Member

smichr commented Mar 21, 2020

For a function that has an asymptote, you want to only use enough y-range to capture the asymptotic approach of the function to the vertical line defining the asymptote. A way to quantify this is to show approximately a length of asymptote that is about 2-5 times the length of the region beween asymptotes. So for tan(x) in the range of 0 to 2pi a vertical range of between 6 - 15 is about right.

For an exponential-like function, perhaps no more than 3 decades of vertical change need be shown relative to the y resolution. Let's say y resolution is corresponds to 1e-5; then the y axis could go from 0 to 0.01. x axis range does not extend far past the point at which all points are less in magnitude than the y resolution.

@ashutosh1919
Copy link
Contributor

@smichr and @sylee957 , I want to work on this issue. Can you please guide me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants