考虑以下情节:
由此函数生成:def timeDiffPlot(dataA, dataB, saveto=None, leg=None):
labels = list(dataA["graph"])
figure(figsize=screenMedium)
ax = gca()
ax.grid(True)
xi = range(len(labels))
rtsA = dataA["running"] / 1000.0 # running time in seconds
rtsB = dataB["running"] / 1000.0 # running time in seconds
rtsDiff = rtsB - rtsA
ax.scatter(rtsDiff, xi, color='r', marker='^')
ax.scatter
ax.set_yticks(range(len(labels)))
ax.set_yticklabels(labels)
ax.set_xscale('log')
plt.xlim(timeLimits)
if leg:
legend(leg)
plt.draw()
if saveto:
plt.savefig(saveto, transparent=True, bbox_inches="tight")
这里重要的是x = 0值的正负差异。最好能更清楚地看到这一点,例如强调x=0轴
从x=0到绘图标记绘制一条线
这可以用matplotlib完成吗?需要添加什么代码?