参考链接: Python | 使用XlsxWriter模块在Excel工作表中绘制雷达图
python中画雷达图
A radar chart compares the values of three or more variables relative to a central point. It’s useful when you cannot directly compare the variables and is especially great for visualizing performance analysis or survey data.
雷达图比较相对于中心点的三个或更多变量的值。 当您无法直接比较变量时,此功能非常有用,尤其对可视化性能分析或调查数据特别有用。
Here’s a sample radar chart, so you can see what we’re talking about. It’s likely you’ve run across them before, even if you didn’t know that’s what they were.
这是一个示例雷达图,因此您可以了解我们在说什么。 即使您不知道那是什么,您也可能曾经遇到过它们。
Creating Radar Charts in Excel is straightforward. In this article, we’ll show you how to create two types of Radar Chart: a regular chart (like the one above) and a filled chart (like the one below, which fills in the areas instead of just showing the outlines).
在Excel中创建雷达图非常简单。 在本文中,我们将向您展示如何创建两种类型的雷达图:常规图(如上面的图)和填充图(如下面的图,它填充区域而不是仅显示轮廓)。
样本数据 (The Sample Data)
Let’s first take a look at the sample data we’ll be using for our examples.
首先让我们看一下将用于示例的示例数据。
We have three trainers: Graham, Barbara, and Keith. We’ve assessed them in five different categories (Knowledge, Delivery, and so on) and our Excel table contains those ratings.
我们有三位培训师:Graham,Barbara和Keith。 我们已经在五个不同的类别(知识,传递等)中对它们进行了评估,并且我们的Excel表中包含这些评分。
在Excel中创建雷达图 (Create a Radar Chart in Excel)
In this first example, we will create a Radar Chart that shows the assessment of all three trainers.
在第一个示例中,我们将创建一个雷达图,显示所有三位培训师的评估。
Select all the cells, including the row that contains the names and the column that contains the assessment titles. Switch to the “Insert” tab and then click the “Waterfall Chart” button.
选择所有单元格,包括包含名称的行和包含评估标题的列。 切换到“插入”选项卡,然后单击“瀑布图”按钮。
You can choose from three Radar Charts from which to pick. Choose the first Radar Chart option for this example. (The second option just adds markers to the values on the lines; the third option fills the chart, and we’ll be looking at that one a bit later.)
您可以从三个雷达图中进行选择。 在此示例中,选择第一个“雷达图”选项。 (第二个选项只是将标记添加到直线上的值;第三个选项填充了图表,稍后我们将对其进行研究。)
Now that you’ve inserted the chart into the worksheet, you can begin to make some improvements to it.
现在,您已将图表插入工作表中,可以开始对其进行一些改进。
输入图表标题 (Enter a Chart Title)
Select the chart title and then type a new title. As you type, the text will appear in the Formula Bar.
选择图表标题,然后键入一个新标题。 键入时,文本将显示在编辑栏中。
When you press Enter, your chart will have a new title.
当您按Enter键时,您的图表将具有一个新标题。
移动传奇 (Move the Legend)
For another change, we could move the legend from above the chart to the right.
要进行其他更改,我们可以将图例从图表上方移至右侧。
When the chart is selected, you’ll see four buttons hovering at its top right. Click the “Chart Elements” button at the top, and then hover your mouse over the “Legend” option. You’ll see an arrow to the right. Click that and then click the “Right” option on the menu that appears.
选择图表后,您会在其右上方看到四个按钮。 单击顶部的“图表元素”按钮,然后将鼠标悬停在“传奇”选项上。 您会在右侧看到一个箭头。 单击该,然后在出现的菜单上单击“右”选项。
修改雷达图轴 (Modify the Radar Chart Axis)
To give our Radar chart a greater impact, and more data clarity, we will modify the axis to begin at three instead of zero.
为了使我们的雷达图具有更大的影响力和更清晰的数据,我们将轴修改为从三开始而不是零开始。
Click the “Chart Elements” button again, hover over the “Axes” option, click the arrow that appears next to it, and then select “More Options.”
再次单击“图表元素”按钮,将鼠标悬停在“轴”选项上,单击旁边的箭头,然后选择“更多选项”。
The Format Axis pane appears on the right. We want to edit the “Minimum” setting under the “Bounds” section, so click that field and type “3” there.
格式轴窗格显示在右侧。 我们要编辑“边界”部分下的“最小”设置,因此单击该字段并在其中键入“ 3”。
The radar chart updates immediately and now that we’ve increased the minimum Bounds value, you can more clearly see the differences in the assessments of the three trainers.
雷达图会立即更新,现在我们增加了最小界限值,您可以更清楚地看到三名教练员评估的差异。
This example gives us a nice view of which trainers excel at which qualities, and also how rounded their skill sets are.
这个例子让我们很好地了解了哪些培训师擅长于哪些素质,以及他们的技能水平如何全面。
创建一个填充雷达图 (Create a Filled Radar Chart)
For a second example, we will create a filled radar chart for just one of the trainers. We will use Keith for this example.
在第二个示例中,我们将仅为其中一名教练创建一个填充雷达图。 在此示例中,我们将使用Keith。
First, select the range of cells that you need. In our example, we want the range A1:A6 and the range D1:D6 as shown below. To do this, hold the Ctrl key while you select each additional cell you want to add to your selection.
首先,选择所需的单元格范围。 在我们的示例中,我们希望范围A1:A6和范围D1:D6如下所示。 为此,在选择要添加到选择中的每个其他单元格时,按住Ctrl键。
Now head to Insert > Waterfall Chart > Filled Radar.
现在转到“插入”>“瀑布图”>“填充雷达”。
When you create a radar chart using only one data series, the axis does not start from zero the way it did in our previous example. Instead, the minimum bound will be the lowest number in the range of cells you selected. In our case, the minimum bound is 4.4—one tick below Keith’s minimum score.
当您仅使用一个数据序列创建雷达图时,轴不会像上一个示例那样从零开始。 而是,最小界限将是所选单元格范围内的最小数字。 在我们的例子中,最小界限为4.4,比Keith的最低分数低一个刻度。
This chart helps you visualize how strong Keith is in each of the assessed qualities.
该图表可帮助您直观地了解Keith在每种评估质量中的实力。
Note that if we were creating more than one radar chart (like, say, we wanted to show a separate chart for each of our trainers), we would want to make sure the axis ranges are consistent so that the data presentation is not misleading. So, for example, we would set the minimum bound to be a bit below the lowest ranking of any trainer and the maximum bound to be a bit higher than the highest ranking of any trainer. You could even remove the axis itself to reduce clutter on the chart.
请注意,如果我们要创建多个雷达图(例如,我们想为我们的每个教练员显示一个单独的图),我们将要确保轴范围是一致的,以便数据显示不会产生误导。 因此,例如,我们将最小界限设置为比任何培训师的最低排名低一些,而最大界限设置为高于任何培训师的最高排名。 您甚至可以删除轴本身,以减少图表上的混乱情况。
Creating radar charts in Excel is simple, but getting the most out of them can require some extra attention. They can be a useful addition to your Excel reports in the future.
在Excel中创建雷达图很简单,但是要充分利用它们可能需要额外的注意。 将来它们可能是对Excel报告的有用补充。
翻译自: https://www.howtogeek.com/402016/how-to-create-a-radar-chart-in-excel/
python中画雷达图
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有