Hello,
I'm trying to make a relatively simple graph in matplotlib but for some reason it keeps coming out looking totally wrong. I'm trying to graph the function E(x)=(-2.408/x) + (9.79x10-5/x10). Here is the code I am using:
I'm trying to make a relatively simple graph in matplotlib but for some reason it keeps coming out looking totally wrong. I'm trying to graph the function E(x)=(-2.408/x) + (9.79x10-5/x10). Here is the code I am using:
import matplotlib.pyplot as plt import numpy as np r_x = np.arange(0.2, 1.2, 0.05) def E(x): return -2.408/x + ((9.79E-5)/(x**10)) plt.plot(r_x, E(r_x)) plt.show()Can someone tell me what I'm doing wrong here? Or why the graph ends up looking completely different than it should? Any help would be appreciated.