Matplotlib 误差条不以标记为中心 [英] Matplotlib errorbar not centered on marker

查看:37
本文介绍了Matplotlib 误差条不以标记为中心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 errorbar 时让误差条居中于标记的技巧是什么?

What's the trick to get the errorbar centered on the marker when using errorbar?

import matplotlib.pyplot as plt
plt.errorbar([1],[1],[0.1],fmt='k^',capsize=5,capthick=2,ms=9,markerfacecolor='none',mew=2)
plt.show()

当尝试使用误差条制作具有演示质量的图时,这非常烦人.我所有的误差条似乎都是一两个像素偏离中心.这也会影响图例.我尝试了各种标记大小和线宽,但是它们始终无法正确居中.在Mac OX 10.8.4上使用matplotlib 1.2.1.在 mpl 1.3.1 上试过,结果一样.

This is very annoying when trying to make presentation-quality plots with errorbars. All my errorbars seem to be a pixel or two off-centered. This affects the legend as well. I tried various marker sizes and linewidths, but they are never centered correctly. Using matplotlib 1.2.1 on Mac OX 10.8.4. Tried on mpl 1.3.1 and got the same results.

推荐答案

已确认的错误.Github问题已创建,并标记为已在MPL 1.4.x中修复

Confirmed bug. Github issue created, and flagged to be fixed in MPL 1.4.x

这篇关于Matplotlib 误差条不以标记为中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆