Adding errorbars in ggplot Python

落爺英雄遲暮 提交于 2019-12-13 02:51:40

问题


Can't find a way of adding errorbars to a Python ggplot plot. The following issue has been neglected for over a year. Nothing in the docs.


回答1:


I had this same problem and found no solution. However I did find a way around it. You can use matplotlib in the style of ggplot. From there it's much easier to use error bars. I've attached an example of some code I used.

plt.style.use('ggplot')

This is an extract of one of my codes

df2.gLongCrFiltered['mean'].plot(kind='bar', yerr=df2.gLongCrFiltered['std'])

which returned this



来源:https://stackoverflow.com/questions/32967697/adding-errorbars-in-ggplot-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!