【问题标题】:gnuplot bins with zero value histogram具有零值直方图的 gnuplot 箱
【发布时间】:2013-07-31 05:31:46
【问题描述】:

我正在尝试在 Gnuplot 中创建 12 个月内每月事件的简单直方图。 bin 2 或 bin 7 中没有事件,并且不是将这些 bin 绘制为 0,而是将相邻的 bin 扩展到该空间上。我正在使用以下直方图绘制例程,我从这里得到:http://gnuplot-surprising.blogspot.com.au/2011/09/statistic-analysis-and-histogram.html

max=12
min=1
binwidth=1
hist(x,width)=x
set style fill solid 0.5
set xrange[0.5:12.5]
plot "file" using (hist($4,binwidth)):(1.0) smooth freq w boxes lc rgb"green"

“文件”中的示例行如下所示:

2008-11-21-08:10:47 29455.0 2008 11 21 19:10:47

第四列是我要绘制的月份信息。生成的直方图位于链接中:

https://docs.google.com/drawings/d/12yFs_KIznhrMx62OIwJJFVmlnwIk4TXdHSdGc0yWqwI/edit?usp=sharing

以 2 和 7(应该为 0)为中心的 bin 丢失,而相邻的 bin 被扩展。我不确定我的错误在哪里,希望有任何帮助!谢谢!

【问题讨论】:

    标签: gnuplot histogram


    【解决方案1】:

    您应该查阅有关boxes 绘图样式的gnuplot 文档。使用

    set boxwidth 1
    

    否则会自动计算每个框的宽度,使其接触相邻的框。

    【讨论】:

      猜你喜欢
      • 2018-10-24
      • 2020-10-26
      • 1970-01-01
      • 1970-01-01
      • 2011-08-12
      • 1970-01-01
      • 2016-02-25
      • 1970-01-01
      • 2012-11-05
      相关资源
      最近更新 更多