Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Sympy plot show wrong calues of y-axis

I was solving a problem using sympy in Visual Studio Code, the y-axis has wrong values as you can see in the attached picture.

I calculated the graphed function at x = 0, and the value is 2.9 * 10^-15, while the value on the graph is 2.9 which is wrong.

How to adjust the graph so that it represent the true values ?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel


result[0] = -1.57105971754913e-10*x**14 + 1.57271456119008e-10*x**13 + 2.50455430685362e-8*x**12 - 2.50462325622519e-8*x**11 - 2.75572538491514e-6*x**10 + 2.75572653284313e-6*x**9 + 0.000198412694745413*x**8 - 0.000198412695713169*x**7 - 0.00833333333219247*x**6 + 0.0083333333326227*x**5 + 0.166666666666487*x**4 - 0.166666666666582*x**3 - 0.999999999999986*x**2 + 0.999999999999997*x - 2.92499929794508e-15

enter image description here

>Solution :

The plot is perfectly fine: you can see the 10^-15 on the top left corner of the plot. It is just that you are using a dark theme with VSCode and matplotlib returns a PNG picture with a transparent figure, which makes it hard to read.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading