擅长:python、mysql、java
<p>以下是我所做的,除了某些值的零除误差(我假设图形渐近线)外,它工作正常:</p>
<pre><code>import matplotlib.pyplot as plt
import numpy as np
def fermi_dirac(x):
fermi_result = (1/(np.exp(x)+1))
return fermi_result
def bose_einstein(x):
bose_result = (1/(np.exp(x)-1))
return bose_result
f = plt.figure()
x_vals = range(-2,3)
plt.plot(x_vals, fermi_dirac(x_vals))
plt.plot(x_vals, bose_einstein(x_vals))
plt.show()
</code></pre>
<p>当您需要更多引用时,这里有pyplot的文档:<a href="https://matplotlib.org/api/_as_gen/matplotlib.pyplot.html" rel="nofollow noreferrer">https://matplotlib.org/api/_as_gen/matplotlib.pyplot.html</a></p>