jupyter markdown绘制甘特图
时间: 2023-11-23 18:57:58 浏览: 166
为了在Jupyter Notebook中使用Markdown绘制甘特图,我们可以使用mermaid库。下面是绘制甘特图的步骤:
1. 首先,需要在Notebook中安装mermaid库。可以使用以下命令进行安装:
```shell
!pip install mermaid
```
2. 在Markdown单元格中,使用以下语法来绘制甘特图:
```mermaid
gantt
dateFormat YYYY-MM-DD
title Adding GANTT diagram functionality to mermaid
section A section
Completed task :done, des1, 2014-01-06,2014-01-08
Active task :active, des2, 2014-01-09, 3d
Future task : des3, after des2, 5d
Future task2 : des4, after des3, 5d
```
其中,dateFormat用于指定日期格式,title用于指定甘特图的标题,section用于指定甘特图的分区,Completed task、Active task、Future task和Future task2用于指定任务名称,done、active和空格用于指定任务状态,des1、des2、des3和des4用于指定任务描述,2014-01-06、2014-01-08、2014-01-09、3d、after des2和5d用于指定任务时间。
3. 运行Markdown单元格,即可在Notebook中看到绘制的甘特图。
阅读全文
相关推荐














