生成具有多个(多组多组)X 轴数据集的图表
我正在寻找一种方法来生成X轴上具有多组数据的图表,每组数据又分为多组多组。 我基本上想采用 此图表 并将类似的图表与其并排放置。 我正在尝试绘制多个服务器上具有不同配置 (0-1) 的相同作业 (0-3) 的持续时间(Y 轴)图(每个组具有相同的 8 个作业)。 希望下图能够说明我想要完成的任务(较小的分组由管道分隔,较大的分组由双管道分隔):
|| 0 1 | 0 1 | 0 1 | 0 1 || 0 1 | 0 1 | 0 1 | 0 1 || 0 1 | 0 1 | 0 1 | 0 1 || || 0 | 1 | 2 | 3 || 0 | 1 | 2 | 3 || 0 | 1 | 2 | 3 || || Server 1 || Server 2 || Server 3 ||
这可以使用 GD::Graph Perl 模块或 matplotlib Python 模块吗? 我找不到关于这个主题的示例或文档。
I am looking for a way to generate a graph with multiple sets of data on the X-axis, each of which is divided into multiple sets of multiple sets. I basically want to take this graph and place similar graphs side by side with it. I am trying to graph the build a graph of the duration (Y-axis) of the same jobs (0-3) with different configurations (0-1) on multiple servers (each group with the same 8 jobs). Hopefully the following diagram will illustrate what I am trying to accomplish (smaller groupings are separated by pipes, larger groupings by double pipes):
|| 0 1 | 0 1 | 0 1 | 0 1 || 0 1 | 0 1 | 0 1 | 0 1 || 0 1 | 0 1 | 0 1 | 0 1 || || 0 | 1 | 2 | 3 || 0 | 1 | 2 | 3 || 0 | 1 | 2 | 3 || || Server 1 || Server 2 || Server 3 ||
Is this possible with either the GD::Graph Perl module or the matplotlib Python module? I can't find examples or documentation on this subject for either.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这里有一些 Python 代码,可以生成您正在寻找的内容。 (该示例使用 3 个配置而不是 2 个配置来确保代码相当通用。)
此代码可能相当透明。 奇怪的术语
(iconfig+2.)/(nconfigs+1)
只是使不同配置的颜色变暗,但保持它们足够明亮,以便可以区分颜色。输出如下所示:
Here's some Python code that will produce what you're looking for. (The example uses 3 configurations rather than 2 to make sure the code was fairly general.)
This code is probably fairly transparent. The odd term
(iconfig+2.)/(nconfigs+1)
is just to dim the colors for the different configurations, but keep them bright enough so the colors can be distinguished.The output looks like:
最近,我看到一张图表,我认为它可以满足您的需求
protovis
我没有该程序的经验,但该图很有启发性我想会给你想要的。
Recently, I saw a graph that I think does what you want using
protovis
I have no experience with the program, but the graph was enlightening and I think would give you want you want.
MathGL 可以轻松做到这一点,而且它也有 Python 接口。 有关示例,请参阅此。
MathGL can do it easily and it have Python interface too. See this for examples.