How to plot a task schedule with matplotlib
<p>I have three lists of tuples containing start time, finish time and column allocation for different tasks. I want to plot these lists into a schedule in the following way: <a href="http://i.stack.imgur.com/hIBjR.png" rel="nofollow"><img src="http://i.stack.imgur.com/hIBjR.png" alt="enter image description here"></a> </p>

<p>Here is the data:</p>

<pre><code>time_start = [('a', 0),
              ('b', 1),
              ('c', 1),
              ('d', 3),
              ('e', 3),
              ('f', 3),
              ('g', 4)]

time_finish = [('a', 1),
               ('b', 3),
               ('c', 3),
               ('d', 4),
               ('e', 4),
               ('f', 4),
               ('g', 6)]

column_allocation = [('a', 'p1'),
                     ('d', 'p1'),
                     ('b', 'p1'),
                     ('g', 'p1'),
                     ('e', 'p2'),
                     ('c', 'p2'),
                     ('f', 'p3')]
</code></pre>

<p>Is this possible?</p>

<p><a href="http://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes.bar" rel="nofollow"><code>axes.bar</code></a> allows you to specify left position, height, and bottom coordinates of each bar, as well as a common width for all bars. Seems like a good fit for your problem.</p>

python python-2.7 matplotlib plot