我正在使用 matplotlib,我想繪制一個圖表,其中 y 軸的負數部分具有較大的數字,而正數部分具有較小的值,而正數部分更有價值。所以我更喜歡以對數刻度繪制 y 軸的負部分,以線性(正常)刻度繪制正部分。在這里,我用對數比例顯示整個情節,這是我的代碼:
plt.plot(time_stamps,objs,'-rD', markevery=markers_on )
markers_on= list(i for i in range(len(upper_bound)))
plt.plot(time_stamps,upper_bound,'-bD', markevery=markers_on )
markers_on= list(i for i in range(len(best_P_list)))
plt.plot(exce_time_list,best_P_list,'-gD', markevery=markers_on)
plt.xlabel("x", fontsize=10)
plt.ylabel("y ", fontsize=10)
plt.yscale('symlog')
plt.show()

如何以線性比例顯示 y 軸的正部分?
uj5u.com熱心網友回復:
我完全修改了我的答案,因為我找到
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/475969.html
標籤:Python matplotlib
上一篇:來自資料框的PythonPandasyerr用于繪圖
下一篇:突出顯示平行坐標圖的特定資料點
