使用 gnuplot 绘制类似 matlab 的 SNR BER 图
SNR BER graph ploting alike matlab with gnuplot
我想在图上指示像 SNR plot 这样启用破折号或圆点 y-tics 的 y 轴对数网格。 Matlab 和类似的程序可以做到这一点,但需要使用 Gnuplot。
### sum up for certain conditions
reset session
set key right box
set object 1 rectangle from screen 0,0 to screen 1,1 fillcolor rgb"#ffffff" behind
set datafile separator comma
set grid
set output 'logscaled.png'
set logscale y 10
set ytics
show ytics
set y2tics
show ytics
set xlabel "SNR"
set ylabel "BER"
plot "snr-ber.csv" title 'Random' w l
### end of code
信噪比
误码率
-5.00
2.8301e-01
-4.00
2.6931e-01
-3.00
2.3582e-01
-2.00
2.2382e-01
-1.00
1.511e-01
0.00
1.4879e-01
1.00
1.2080e-01
2.00
1.1439e-01
3.00
8.5206e-02
4.00
6.6113e-02
5.00
4.7682e-02
6.00
3.3031e-02
7.00
2.2605e-02
8.00
5.61010e-03
9.00
3.6660e-03
10.00
8.5350e-04
11.00
2.7550e-04
12.00
4.8500e-05
13.00
1.6000e-06
14.00
0.0000e+00
set grid x y my
将为沿 x 轴和 y 轴的主要抽动以及沿 y 轴的次要抽动启用网格线。
我想在图上指示像 SNR plot 这样启用破折号或圆点 y-tics 的 y 轴对数网格。 Matlab 和类似的程序可以做到这一点,但需要使用 Gnuplot。
### sum up for certain conditions
reset session
set key right box
set object 1 rectangle from screen 0,0 to screen 1,1 fillcolor rgb"#ffffff" behind
set datafile separator comma
set grid
set output 'logscaled.png'
set logscale y 10
set ytics
show ytics
set y2tics
show ytics
set xlabel "SNR"
set ylabel "BER"
plot "snr-ber.csv" title 'Random' w l
### end of code
信噪比 | 误码率 |
---|---|
-5.00 | 2.8301e-01 |
-4.00 | 2.6931e-01 |
-3.00 | 2.3582e-01 |
-2.00 | 2.2382e-01 |
-1.00 | 1.511e-01 |
0.00 | 1.4879e-01 |
1.00 | 1.2080e-01 |
2.00 | 1.1439e-01 |
3.00 | 8.5206e-02 |
4.00 | 6.6113e-02 |
5.00 | 4.7682e-02 |
6.00 | 3.3031e-02 |
7.00 | 2.2605e-02 |
8.00 | 5.61010e-03 |
9.00 | 3.6660e-03 |
10.00 | 8.5350e-04 |
11.00 | 2.7550e-04 |
12.00 | 4.8500e-05 |
13.00 | 1.6000e-06 |
14.00 | 0.0000e+00 |
set grid x y my
将为沿 x 轴和 y 轴的主要抽动以及沿 y 轴的次要抽动启用网格线。