matplotlib tutorial (9) nitta@tsuda.ac.jp

Chapter 9: Bar Graph

9-1: Drawing a Bar Graph pyplot.bar

9-2: Eliminate the gap between bars in the bar graph

9-3: Set the bar color, border width and color respectively

9-4: Show error bar

9-5: Show error bars on a horizontal bar graph using Axes.barh

9-6: Show error bars and axis values at the tip of 2-axis bar graph Axes.bar

You can use Axes.bar to create a 2-axis bar graph. Place a label text indicating the value at the tip of the bar.

matplotlib.axes.Axes.bar(x,height,width,bottom,*,align='center',**kwargs) ... The width of the bar is specified as a ratio of the width between the axes (default: 0.8).

9-7: Toggle between the top and bottom of the error bar errobar

    Axes.errorbar(x,y,
                  yerr=None,   # error bar のy方向のサイズ
                  xerr=None,   # error bar のx方向のサイズ
                  fmt='',      # markerの形状 'none'/'o'/'^'/'<'
                  ecolor=None,
                  elinewidth=None,
                  lolims=False,
                  uplims=False,
                  xlolims=False,
                  xuplims=False,
                  **kwargs)