给定间隔和数据时如何绘制图表

发布于 2024-11-17 08:55:39 字数 256 浏览 2 评论 0原文

假设我获得了一些如下数据:-

Size-Range Percentage

[1-3] 2% [3-8] 6% [8-20] 10% [20-50] 30% [50-100] 80% [100-200] 99.99%

假设我运行一个包含许多数据文件的算法,并得到这个输出。 第一列显示算法的时间,第二列显示处理的数据的百分位数。 我只想绘制这些数据。 我想画一些图表。

请建议我如何使用 gnuplot 或任何其他工具来做到这一点。

Suppose i have obtained some data which is like this :-

Size-Range Percentage

[1-3] 2%
[3-8] 6%
[8-20] 10%
[20-50] 30%
[50-100] 80%
[100-200] 99.99%

Suppose i run an algorithm with many data files and i got this output.
1st column shows the time of algorithm and 2nd column shows the percentile of data processed.
I just want to plot this data.
I want to draw some graph.

Please suggest me how can i do this using gnuplot or any other tool.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

筑梦 2024-11-24 08:55:39

您可以在 R 中绘制直方图或条形图(有关更多详细信息此处)。有关此方向的优秀教程,请参阅 Producing Simple Graphs与 R。

例如,假设您的 CSV 文件中有数据,如下所示:

Lo,Hi,Percentage
1,3,2
3,8,6
...
100,200,99.99

然后,要在 R 中加载 CSV 文件,您可以编写:

> dataSample <- read.csv(file="C:/sample.csv", head=TRUE, sep=",")

请注意,在 *NIX 计算机上,您应该将文件路径替换为“/home” /用户名/路径/to/sample.csv”。要检查这些值,只需键入:

> dataSample

从这里,您可以使用数据来绘制图表,就像教程中一样。

You can draw a histogram or a barplot in R (more details about it here). For a good tutorial in this direction, please see Producing Simple Graphs with R.

For example, suppose you have the data in a CSV file which looks like this:

Lo,Hi,Percentage
1,3,2
3,8,6
...
100,200,99.99

Then, to load the CSV file in R you could write:

> dataSample <- read.csv(file="C:/sample.csv", head=TRUE, sep=",")

Note that on *NIX machines you should replace the path to your file with something like "/home/username/path/to/sample.csv". To check the values, simply type:

> dataSample

From here, you can use the data to plot your graphs like in the tutorial.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文