首页 > 解决方案 > Plotting duration on a timeline in Python

问题描述

I'd like to plot the sequential spans of different people vertically on a shared (temporal) x-axis. My data looks like this:

    Name                start       end
0   John Rutledge   1790-02-15  1791-03-05
1   William Cushing 1790-02-02  1810-09-13
2   James Wilson    1789-10-05  1798-08-21
3   John Blair      1790-02-02  1795-10-25
4   James Iredell   1790-05-12  1799-10-20

Desired output is something like this:

enter image description here

I've seen some fairly complex 'roll-your-own' versions of this, but isn't there something simple?

标签: pythonpandasmatplotlibdata-visualizationseaborn

解决方案


推荐阅读