matplotlib: How to combine multiple bars with lines
<p>I have a very simple grouped-bar chart with 5 groups of 4 bars each. I used the example from the <a href="http://matplotlib.org/examples/api/barchart_demo.html" rel="noreferrer">matplotlib documentation</a>, which goes like this:</p>

<pre><code>import numpy as np
import matplotlib.pyplot as plt

ind = np.arange(5)
avg_bar1 = (81191,79318,57965,60557,14793)
avg_bar2 = (26826,26615,31364,31088,55472)
avg_bar3 = (36232,38038,38615,39014,40812)
avg_bar4 = (26115,25879,25887,28326,27988)

fig, ax = plt.subplots()

rects1 = ax.bar(ind, avg_bar1, 0.15, label='bar1')
rects2 = ax.bar(ind + 0.15, avg_bar2, 0.15, label='bar2')
rects3 = ax.bar(ind + 0.30, avg_bar3, 0.15, label='bar2')
rects4 = ax.bar(ind + 0.45, avg_bar4, 0.15, label='bar2')

plt.xlabel('Distributions')
plt.ylabel('ms')
plt.xticks(ind + 0.15, ('50/50', '60/40', '70/30', '80/20', '90/10'))
plt.legend()

plt.tight_layout()
plt.show()
</code></pre>

<p><strong>Problem</strong> </p>

<p>But some values of bars in the corresponding other groups (e.g. bar1 in group1 and bar1 in group2, etc.) do not differ that much from each other. </p>

<p><strong>What I want</strong></p>

<p>So I want to <em>add lines</em> in order to see the <em>trend</em> of each group more clearly. The lines should go from the top of each bar in one group to the top of the bar in the corresponding other groups.</p>

<p>I couldn't find anything similar on the web. </p>

<p>Is that possible? </p>