gnuplot 热图:数据出现“倾斜”

发布于 2025-01-10 09:55:12 字数 1553 浏览 0 评论 0原文

我需要一些帮助

我有一个巨大的文件,其中包含 256 个频率,其幅度每 3 秒一次,这意味着对于每个特定时间(即 18:04:01),有 256 行。第一列是时间:YYYY-MM-DD-HH-MM-SS,第二列是频率,第三列是幅度值。每列都用空格分隔

2022-02-27-18:39:57 1.823047180175781250e+02 -4.882478713989257812e+01
*<256 lines>*
2022-02-27-18:39:57 1.6047180175781250e+02 -4.882478713989257812e+01
2022-02-27-18:39:54 1.823047180175781250e+02 -4.533270263671875000e+01
*<256 lines>*
2022-02-27-18:39:54 1.6047180175781250e+02 -4.882478713989257812e+01

这是我用来绘制此图的 gnuplot 代码:

clear
reset
reset session
set timestamp "Generated:  %Y-%m-%d %H:%M:%S" top font 'Arial,16'
set datafile separator " "
set datafile missing "nan"
set term pngcairo
set terminal png size 1500,800
set title "$systemName \n \nSpectrum\n Most recently appended:  $file_most_current_pwr" font 'Consolas,19' noenhanced
set cblabel "Amplitude dB" offset 3 font 'Consolas, 15'
set cbtics scale 0 font 'Arial,16'
#set cbrange [:-40]
set palette rgbformulae 22,13,-31
unset key
set timefmt "%Y-%m-%d-%H:%M:%S"
set xdata time
set format x "%H:%M:%S"
set ylabel 'MHz' font 'Arial,19' offset 0,2
set xlabel 'Time' font 'Arial,19' 
set output "/var/www/html/and_power_plot.png"
plot "/var/www/html/Data_Archive/current_master_PWR_data.txt" using 1:2:3 with image

但是,我得到的热图看起来“倾斜”。此外,当我将更多数据附加到文件时,我收到此错误:

Visible pixel grid has a scan line longer than previous scan lines

这是图表:

倾斜的 GNUplot 热图 有什么

建议吗?

I need some help

I have huge file that contains 256 frequencies with their amplitudes every 3 seconds, meaning for each specific time (i.e. 18:04:01), there is 256 lines. The first column is the time: YYYY-MM-DD-HH-MM-SS, the second columns is the frequency, and the third column is the amplitude value. Each column is separated with a space

2022-02-27-18:39:57 1.823047180175781250e+02 -4.882478713989257812e+01
*<256 lines>*
2022-02-27-18:39:57 1.6047180175781250e+02 -4.882478713989257812e+01
2022-02-27-18:39:54 1.823047180175781250e+02 -4.533270263671875000e+01
*<256 lines>*
2022-02-27-18:39:54 1.6047180175781250e+02 -4.882478713989257812e+01

Here is the gnuplot code that I am using to plot this:

clear
reset
reset session
set timestamp "Generated:  %Y-%m-%d %H:%M:%S" top font 'Arial,16'
set datafile separator " "
set datafile missing "nan"
set term pngcairo
set terminal png size 1500,800
set title "$systemName \n \nSpectrum\n Most recently appended:  $file_most_current_pwr" font 'Consolas,19' noenhanced
set cblabel "Amplitude dB" offset 3 font 'Consolas, 15'
set cbtics scale 0 font 'Arial,16'
#set cbrange [:-40]
set palette rgbformulae 22,13,-31
unset key
set timefmt "%Y-%m-%d-%H:%M:%S"
set xdata time
set format x "%H:%M:%S"
set ylabel 'MHz' font 'Arial,19' offset 0,2
set xlabel 'Time' font 'Arial,19' 
set output "/var/www/html/and_power_plot.png"
plot "/var/www/html/Data_Archive/current_master_PWR_data.txt" using 1:2:3 with image

However, I am getting a heatmap that looks "slanted". In addition, I received this error when I append further data to the file:

Visible pixel grid has a scan line longer than previous scan lines

Here is the graph:

Slanted GNUplot heatmap

Any advice ?

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

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

发布评论

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

评论(1

夜声 2025-01-17 09:55:12

好吧,事实证明数据每行之间必须有一个空行,例如,而不是:

2022-02-27-18:39:57 1.82000000000000e+02 -4.882478713989257812e+01
2022-02-27-18:39:57 1.70000000000000e+02 -3.8567889999398992e+01
2022-02-27-18:39:57 1.62300000000050e+02 -4.882478711568033333812e+01

需要像这样:

2022-02-27-18:39:57 1.82000000000000e+02 -4.882478713989257812e+01

2022-02-27-18:39:57 1.70000000000000e+02 -3.8567889999398992e+01

2022-02-27-18:39:57 1.62300000000050e+02 -4.882478711568033333812e+01

Ok, so it turns out that the data has to have a blank line between each line, for example, instead of:

2022-02-27-18:39:57 1.82000000000000e+02 -4.882478713989257812e+01
2022-02-27-18:39:57 1.70000000000000e+02 -3.8567889999398992e+01
2022-02-27-18:39:57 1.62300000000050e+02 -4.882478711568033333812e+01

needs to be like this:

2022-02-27-18:39:57 1.82000000000000e+02 -4.882478713989257812e+01

2022-02-27-18:39:57 1.70000000000000e+02 -3.8567889999398992e+01

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