Seaborn horizontal bar plot

后端 未结 1 674
傲寒
傲寒 2021-01-16 11:09

The default Seaborn barplot almost works for me albeit a few details. It is shown below:

Please look at the \'text\' annotation alongside and to the right

1条回答
  •  梦毁少年i
    2021-01-16 12:00

    1. Concerning the first point, we need a minimal, complete, verifiable example.

    2. In order to put space between the edge bars and the axes, one can adjust the limits of the axes. ax.set_ylim(-1,N), where N is the number of bars.

    3. The width of the bars can be set with the width argument of plt.bar. plt.bar(..., width=1); or, for horizontal bars, use the height argument. The seaborn bar plot does not allow to set the width or height.

    4. Same as 2, just with ax.set_xlim(0,barmax*1.4), where barmax is the maximum length of the bar.

    0 讨论(0)
提交回复
热议问题