このコードでJavaPlotを使用してスペクトログラムを表示しようとしています:
PlotStyle style = new PlotStyle();
style.setStyle(Style.IMAGE);
DataSetPlot data = new DataSetPlot(points);
data.setPlotStyle(style);
JavaPlot plot = new JavaPlot();
plot.addPlot(data);
plot.plot();
次のようにコマンドラインでgnuplotを使用すると、ポイントが有効になります。
gnuplot --persist -e 'plot "data.dat" w image'
問題は、上記のコードでは画像がまったく表示されず、すべて白であることです。ただし、前のコマンドは正常に機能し、data.dat にはまったく同じ形式のポイントが含まれています。コードを実行してもエラーは表示されません。
いくつかのポイント データの例を次に示します。
0.0 193.0 0.18183826861232413
0.0 194.0 0.2467637036800797
0.0 195.0 0.43531750893288235
0.0 196.0 0.3893599780473012
0.0 197.0 0.3220816458659573
0.0 198.0 0.25389713892289173
0.0 199.0 0.22935136709597423
1.0 0.0 0.23021155472288352
1.0 1.0 0.33383157107150707
1.0 2.0 0.3745792715533692
1.0 3.0 2.028348052193793
1.0 4.0 2.4150235476868978
1.0 5.0 2.4169194327766736
1.0 6.0 1.8633442057577019
1.0 7.0 4.2682342944471054
1.0 8.0 3.22544345282322
そして、これは JavaPlot によって gnuplot に送られるコマンドです:
set multiplot layout 1,2 rowsfirst downwards
_gnuplot_error = 1
plot '-' title 'Datafile 1' with image ; _gnuplot_error = 0
0.0 9.0 6.612583996900796
1.0 9.0 4.719585678813712
2.0 9.0 0.5475948495661151
3.0 9.0 0.7385211622757041
4.0 9.0 0.711512824841686
5.0 9.0 3.7572382303712604
6.0 9.0 1.0818137070547578
7.0 9.0 0.057188125070687344
8.0 9.0 0.8218555010675036
9.0 9.0 5.754170136586405
e
if (_gnuplot_error == 1) print '_ERROR_'
unset multiplot
quit
この例では、10x10 ポイントを取得したため、渡される座標は次のようになります。
0.0 0.0 6.612583996900796
0.0 1.0 4.719585678813712
0.0 2.0 0.5475948495661151
0.0 3.0 0.7385211622757041
0.0 4.0 0.711512824841686
0.0 5.0 3.7572382303712604
0.0 6.0 1.0818137070547578
0.0 7.0 0.057188125070687344
0.0 8.0 0.8218555010675036
0.0 9.0 5.754170136586405
1.0 0.0 6.612583996900796
1.0 1.0 4.719585678813712
1.0 2.0 0.5475948495661151
1.0 3.0 0.7385211622757041
1.0 4.0 0.711512824841686
1.0 5.0 3.7572382303712604
1.0 6.0 1.0818137070547578
1.0 7.0 0.057188125070687344
1.0 8.0 0.8218555010675036
1.0 9.0 5.754170136586405
...
9.0 9.0 xxxxxxxxxxxxx
JavaPlot が Y 座標を反復していないようです。
誰かが私が間違っていることを知っていますか?