首页 > 解决方案 > 带有 Python 的靶心图

问题描述

我想bullseye chartpandas data frame. dataframecontains ,products将按开发阶段和产品组进行分组。例如这样的:

import pandas as pd

df = pd.DataFrame({'Product': ['ABC','DEF','GHI','JKL','MNO','PQR','STV','WYX','ZZZ'],
                       'Phase': [1,2,3,1,2,3,1,2,3],
                       'Group': ['Group1','Group2','Group1','Group2','Group2','Group2','Group3','Group2','Group1']},
                       columns = ['Product', 'Phase', 'Group'])
df

  Product Phase Group
0   ABC     1   Group1
1   DEF     2   Group2
2   GHI     3   Group1
3   JKL     1   Group2
4   MNO     2   Group2
5   PQR     3   Group2
6   STV     1   Group3
7   WYX     2   Group2
8   ZZZ     3   Group1

产品应在bullseye chart. 第二列(开发阶段)将确定环。Phase 1: outer ring, Phase 2: middle ring, phase 3: center. Then the products should be grouped in the rings by their product group. 结果应该类似于下图。是否可以在 python 中使用或其他方式显示这样chart的?automated mannermatplotlib

靶心图

标签: pythonpandasmatplotlib

解决方案


推荐阅读