简体   繁体   English

每个点的标记边缘颜色或matplotlib.axes.Axes.errorbar(Python包)的其他标记

[英]Marker edge colors or just other markers of matplotlib.axes.Axes.errorbar (Python Package) to every point

Is there any way to use color markers of matplotlib.axes.Axes.errorbar (Python Package), or just other markers, to every point? 有没有办法在每个点上使用matplotlib.axes.Axes.errorbar(Python包)的颜色标记,或者仅使用其他标记?

Example: 例:

err = np.array([0.0, math.log(0.0423746910453,10), math.log(0.26659516937,10)])

plt.errorbar(x,y,yerr=err,marker='^',markeredgecolor='gray')

I would like to have a color marker, or just other marker, to every point (error). 我想对每个点(错误)使用一个颜色标记或其他标记。

  • Point 1: 0.0 -> markeredgecolor='red', or marker='^' 点1:0.0-> markeredgecolor ='red'或marker ='^'
  • Point 2: math.log(0.0423746910453,10) -> markeredgecolor='blue', or marker='X' 点2:math.log(0.0423746910453,10)-> markeredgecolor ='blue'或marker ='X'
  • Point 3: math.log(0.26659516937,10) -> markeredgecolor='green', or marker='o' 第三点:math.log(0.26659516937,10)-> markeredgecolor ='green'或marker ='o'

I'm not sure if there matplotlib supports this natively, however you can simply workaround this limitation: 我不确定是否有matplotlib本身支持此功能,但是您可以解决此限制:

First, draw the line connecting the points with plt.plot(x, y) . 首先,绘制连接点与plt.plot(x, y) You can then draw each marker separately by calling plt.errorbar for each point with different options. 然后,可以通过使用不同的选项为每个点调用plt.errorbar来分别绘制每个标记。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM