Interactive Slider Bar Chart Color Control

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 12:28:56
ImportanceOfBeingErnest

Simply delete the line

ax.bar(df.index, avg, width=1, edgecolor='k', color='silver')

I don't know why you put it there, but it will plot a complete unicolor barchart on top of the colored bars and hide them.


In order to make some interaction possible, an interactive backend needs to be used. So it will not work out of the box in IPython when %matplotlib inline mode is set. Options you have:
  • Using %matplotlib notebook in IPython Qt console or jupyter notebook.
  • Using a GUI backend when running code as a script, by adding plt.show(). In Spyder that can be ensured by running the script in a new dedicated window as sketched here.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!