我试图在表示限制的日志日志图上绘制各种点。我正在使用matplotlib的errorbar。但是,箭头的大小因点而异。如何生成恒定大小的限制箭头?
我的代码如下:
from math import pi
import numpy as np
import pylab as pl
x_1 = np.arange(0.,10.)
y_1 = np.arange(11.,20.)
x_1_avg = np.sum(x_1)/len(x_1)
y_1_avg = np.sum(y_1)/len(y_1)
x_2 = np.arange(11.,20.)
y_2 = np.arange(21.,30.)
x_2_avg = np.sum(x_2)/len(x_2)
y_2_avg = np.sum(y_2)/len(y_2)
pl.yscale('log')
pl.xscale('log')
pl.errorbar(x_1_avg, y_1_avg, yerr = 2, color = 'g', lolims=-y_1_avg)
pl.errorbar(x_2_avg, y_2_avg, yerr = 2, color = 'r', lolims=-y_2_avg)
pl.savefig('test.eps')
pl.show()