簡體   English   中英

如何在 matplotlib 中渲染具有不確定性的行 plot

[英]How to render line plot with uncertainty in matplotlib

我想知道我是否可以使用 plot 繪制一張圖表,其中我使用 matplotlib 顯示了一系列最佳和最差結果。結果應該如下所示:

我想在此處復制的圖表圖像。

您是否看到每個點周圍的范圍指定了最佳和最差的衡量標准是什么? 這正是我要找的。

我很確定錯誤欄 function 完全符合您的要求: https://matplotlib.org/3.5.0/api/_as_gen/matplotlib.pyplot.errorbar.html

import numpy as np
import matplotlib.pyplot as plt
x = np.arange(10)
y = np.arange(10)
# yerr can be a single number or an array with same length as x and y
# depending on whether you want it to be constant or changing
yerr = 1
plt.errorbar(x, y, yerr=yerr)
plt.show()

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM