Interactive Slider Bar Chart Color Control

前端 未结 1 532
野性不改
野性不改 2021-01-26 13:09

I have four sets of random normal distributed numbers. The means are used to plot bar chart with each set\'s 95% confidence intervals plotted with errorbar.

Given a valu

相关标签:
1条回答
  • 2021-01-26 13:47

    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.
    0 讨论(0)
提交回复
热议问题