2013-03-14 3 views
6

私はgnuplotを使って私が持っているデータセットを可視化しようとしています(Javaでは大したことではありません)。私はこれに関するいくつかの異なる質問をすることができますが、今のところ:自分のデータがカテゴリー的であり、各カテゴリーについて、そのカテゴリーのサンプルの1,2,3、最小および最大、および全重量があるとします実際のサンプルデータ)。私はGNUplot 'candlesticks'を使ってこれをプロットしたいと思います。ボックスの幅を用いた試料の重量を可視化以外のgnuplotで可変ボックス幅のbox-and-whiskerプロットを生成するにはどうすればよいですか?

the 'candlesticks' plot

:私はほとんどこれを取得することができます。

これはgnuplot 'candlesticks'プロットで行うことができますか?他の方法ですか?

参考:私は主にgnuplotを使ってこれを行うことに興味があります。他の提案は、簡単にスクリプト化でき、あまり多くの追加ソフトウェアをインストールする必要がない場合にのみ、歓迎されます。

答えて

12

[OK]を取得します。

サンプルスクリプト:data.txt

set terminal pngcairo transparent enhanced font "arial,10" fontscale 1.0 size 500, 350 
set output 'candlesticks.png' 
set boxwidth 0.2 absolute 
set title "Box-and-whisker plot with median bar, whiskerbars, and variable box width" 
set xrange[0:5] 
set yrange[0:25] 

# Data columns: X Min 1stQuartile Median 3rdQuartile Max BoxWidth Titles 

# set bars 4.0 
set style fill empty 
plot 'data.txt' using 1:3:2:6:5:7:xticlabels(8) with candlesticks title 'Quartiles' whiskerbars, \ 
    ''   using 1:4:4:4:4:7 with candlesticks lt -1 notitle 

サンプル内容:

# Data columns: X Min 1stQuartile Median 3rdQuartile Max BoxWidth Titles 
1 5 7 10 15 24 0.3 Quick 
2 6 8 11 16 23 0.4 Fox 
3 5 7 11 17 22 0.5 Lazy 
4 6 9 10 18 21 0.3 Dog 

(と#行は単なるコメントであることに注意してください、私たちは本当にカラム名を指定しないでください。)

結果:

Plot

関連する問題