title: Create a horizontal waterfall chart with python matplotlib
body: <p>I am trying to create a waterfall chart, which is like a bar chart, except that each bar starts at the end of its neighboring bars, at the end or beginning, so you have the total, and can see how it breaks down.<br>
  I am trying to create this chart in python, but there are no direct charts in <code>matplot.lib</code> called waterfall.</p>
  
  <p>I found code for a vertical waterfall, but I could not transform it to horizontal.  </p>
  
  <p>How can I transform a <code>barh</code> matplot chart, for example, to a horizontal waterfall?  </p>
  
  <p>I want to create a HORIZONTAL waterfall.</p>
  
  <p>For example, I am trying to make each bar in <code>barh</code> chart in matplotlib start at end of other, but I do not think I am approaching the problem the right way, because I have no results so far.<br>
  It should look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/uaXbk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uaXbk.jpg" alt="enter image description here"></a></p>
  
  <p>Code to create the plot:  </p>
  
  <pre><code>my_plot = trans.plot(
      kind='barh', 
      stacked=True, 
      bottom=blank,legend=None, 
      figsize=(10, 5)
  )
  </code></pre>
  
  <p>How do I separate the bars?  </p>
  
  <p>EDIT</p>
  
  <p>I have found this ready to use python package, but it doesn't work with dataframes, so I cannot use it.</p>
  
  <pre><code>import waterfall_chart
  from matplotlib import transforms
  
  a = ['sales','returns','credit fees','rebates','late charges','shipping']
  b = [10,-30,-7.5,-25,95,-7]
  
  my_plot = waterfall_chart.plot(a, b, rotation_value=30, sorted_value=True, threshold=0.2,
                                 formatting="$ {:,.1f}", net_label="end result", other_label="misc",
                                 Title="chart", x_lab="X", y_lab="money", blue_color="blue",
                                 green_color="#95ff24", red_color="r")
  
  rot = transforms.Affine2D().rotate_deg(90)
  
  
  my_plot.show()
  
  </code></pre>
  
  <p>I also found this tutorial, with code, for a vertical waterfall chart.<br>
  <a href="https://pbpython.com/waterfall-chart.html" rel="nofollow noreferrer">https://pbpython.com/waterfall-chart.html</a>.<br>
  It works great, but I didn't manage to reproduce the same thing for a horizontal waterfall.  </p>