简体   繁体   English

如何在 Excel 中创建阶梯图?

[英]How do I create a Step Graph in Excel?

Suppose I have a set of values: <0-4.5, 1>, <4.6-9.3, 2>, <9.4-12.2, 3> and I want to display a simple, three step graph.假设我有一组值:<0-4.5, 1>, <4.6-9.3, 2>, <9.4-12.2, 3> 我想显示一个简单的三步图。 One step would span from zero to 4.5 and the height should be 1, the second step from 4.6 to 9.3 and the height would be 2 and so on.一步从 0 到 4.5,高度应该是 1,第二步从 4.6 到 9.3,高度应该是 2,依此类推。

How do I do it in Excel?我如何在 Excel 中做到这一点?

Edit: A hack would be to generate pairs: <0,1>, <0.1,1>...<4.4,1>, <4.5,1> and use a scatter graph.编辑:一个技巧是生成对: <0,1>, <0.1,1>...<4.4,1>, <4.5,1> 并使用散点图。 But, really!但是,真的!

Use the following data set:使用以下数据集:

| x    | y |
|------|---|
| 0.1  | 1 |
| 0.2  | 1 |
| 0.3  | 1 |
| 0.4  | 1 |
| 0.5  | 1 |
| 0.6  | 1 |
| 0.7  | 1 |
| 0.8  | 1 |
| 0.9  | 1 |
| 1    | 1 |
| 1.1  | 1 |
| 1.2  | 1 |
| 1.3  | 1 |
| 1.4  | 1 |
| 1.5  | 1 |
| 1.6  | 1 |
| 1.7  | 1 |
| 1.8  | 1 |
| 1.9  | 1 |
| 2    | 1 |
| 2.1  | 1 |
| 2.2  | 1 |
| 2.3  | 1 |
| 2.4  | 1 |
| 2.5  | 1 |
| 2.6  | 1 |
| 2.7  | 1 |
| 2.8  | 1 |
| 2.9  | 1 |
| 3    | 1 |
| 3.1  | 1 |
| 3.2  | 1 |
| 3.3  | 1 |
| 3.4  | 1 |
| 3.5  | 1 |
| 3.6  | 1 |
| 3.7  | 1 |
| 3.8  | 1 |
| 3.9  | 1 |
| 4    | 1 |
| 4.1  | 1 |
| 4.2  | 1 |
| 4.3  | 1 |
| 4.4  | 1 |
| 4.5  | 1 |
| 4.6  | 2 |
| 4.7  | 2 |
| 4.8  | 2 |
| 4.9  | 2 |
| 5    | 2 |
| 5.1  | 2 |
| 5.2  | 2 |
| 5.3  | 2 |
| 5.4  | 2 |
| 5.5  | 2 |
| 5.6  | 2 |
| 5.7  | 2 |
| 5.8  | 2 |
| 5.9  | 2 |
| 6    | 2 |
| 6.1  | 2 |
| 6.2  | 2 |
| 6.3  | 2 |
| 6.4  | 2 |
| 6.5  | 2 |
| 6.6  | 2 |
| 6.7  | 2 |
| 6.8  | 2 |
| 6.9  | 2 |
| 7    | 2 |
| 7.1  | 2 |
| 7.2  | 2 |
| 7.3  | 2 |
| 7.4  | 2 |
| 7.5  | 2 |
| 7.6  | 2 |
| 7.7  | 2 |
| 7.8  | 2 |
| 7.9  | 2 |
| 8    | 2 |
| 8.1  | 2 |
| 8.2  | 2 |
| 8.3  | 2 |
| 8.4  | 2 |
| 8.5  | 2 |
| 8.6  | 2 |
| 8.7  | 2 |
| 8.8  | 2 |
| 8.9  | 2 |
| 9    | 2 |
| 9.1  | 2 |
| 9.2  | 2 |
| 9.3  | 2 |
| 9.4  | 3 |
| 9.5  | 3 |
| 9.6  | 3 |
| 9.7  | 3 |
| 9.8  | 3 |
| 9.9  | 3 |
| 10   | 3 |
| 10.1 | 3 |
| 10.2 | 3 |
| 10.3 | 3 |
| 10.4 | 3 |
| 10.5 | 3 |
| 10.6 | 3 |
| 10.7 | 3 |
| 10.8 | 3 |
| 10.9 | 3 |
| 11   | 3 |
| 11.1 | 3 |
| 11.2 | 3 |
| 11.3 | 3 |
| 11.4 | 3 |
| 11.5 | 3 |
| 11.6 | 3 |
| 11.7 | 3 |
| 11.8 | 3 |
| 11.9 | 3 |
| 12   | 3 |
| 12.1 | 3 |

Highlight the data set, and insert a chart using Recommended Charts and pick the one you prefer as shown below.突出显示数据集,并使用Recommended Charts插入图表,然后选择您喜欢的图表,如下所示。

样本

It can be a bar chart or line chart not necessarily a scatter chart, but the preparation is similar.它可以是条形图或折线图,不一定是散点图,但准备是类似的。 Charting is not that intuitive in excel and needs a lot of workarounds sometimes. excel 中的图表不是那么直观,有时需要很多变通方法。

Cheers:)干杯:)

I'm not sure exactly how you want the graph to look, but another workaround is to select a scatter joined by lines.我不确定您希望图表看起来如何,但另一种解决方法是 select 由线条连接的散点图。 If you want a gap anywhere, put in a missing value:如果您想在任何地方留出空白,请输入缺失值:

+------+---+
|  x   | y |
+------+---+
|    0 | 0 |
|    0 | 1 |
|  4.5 | 1 |
|  4.5 | 0 |
|      |   |
|  4.6 | 0 |
|  4.6 | 2 |
|  9.3 | 2 |
|  9.3 | 0 |
|      |   |
|  9.4 | 0 |
|  9.4 | 3 |
| 12.2 | 3 |
| 12.2 | 0 |
+------+---+

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM