【发布时间】:2020-03-31 16:50:58
【问题描述】:
我正在尝试使用 matplotlib 在 Python 中使用非线性 x 轴,但没有找到任何函数或解决此问题。
这就是我们的graph 在这个时间点上的样子,我想把它转换成类似this. 的东西(看看两个图的 x 轴的差异)
我现在的代码是:
plt.axis([0, 100, 0, 1])
plt.plot(onecsma_x, onecsma_y, label='1-CSMA')
plt.plot(slotted_aloha_x,slotted_aloha_y, label ='Slotted Aloha')
plt.plot(pure_aloha_x,pure_aloha_y, label ='Pure Aloha')
plt.plot(npcsma_x, npcsma_y, label ='Non persisten CSMA')
plt.plot(pcsma_x, pcsma_y, label ='P persistent CSMA')
plt.legend(loc='upper right')
plt.show()
【问题讨论】:
标签: python matplotlib graph axes