这是我到目前为止的代码,我正在尝试设置y极限为[0,4],x极限为[-2,3]。我可以自己处理情节标题,但我不知道如何在同一个图上得到这两个函数。你知道吗
import math as m
from matplotlib import pylab 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
以下是我所做的,除了某些值的零除误差(我假设图形渐近线)外,它工作正常:
当您需要更多引用时,这里有pyplot的文档:https://matplotlib.org/api/_as_gen/matplotlib.pyplot.html
这是一个模板,让你去
要在同一个绘图上获得这些函数,只需使用
plt.plot(...)
两次。你知道吗引用:How to plot multiple functions on the same figure, in Matplotlib?
输出:
相关问题 更多 >
编程相关推荐