我使用 Python 绘制了以下图:
import matplotlib.pyplot as plt
plt.hist([x*100 for x in relativeError], bins = 100)
plt.xlabel("Relative Error [%]")
plt.ylabel("#samples")
plt.axvline(x=0, linestyle='--',linewidth=1, color='grey')
Run Code Online (Sandbox Code Playgroud)
但我真正想要的是根据值是正值还是负值来拥有不同的颜色。