gnuplotのコマンドセットの備忘録 その4.
今回は,複数データの棒グラフを作成する.
Microsoft Windows 10 Home (64bit)
Gnuplot Version 5.2 patchlevel 0
軸目盛りと,2種のデータを並べているだけである.
# last year this year Mar 35.71 179.69 Apr 83.33 232.76 : : :
set key left top
set yrange[0:]
set style data histogram
set style histogram cluster gap 1
set style fill solid
# set boxwidth 0.5
set ylabel "Average Power [W]"
plot "plot.dat" using 2:xtic(1) title "last year" linecolor rgb "light-blue", \
             '' using 3         title "this year" linecolor rgb "light-red"
set tics    font "Consolas,12"
set key     font "Consolas,12"
set title   font "Consolas,12"
set xlabel  font "Consolas,12"
set ylabel  font "Consolas,12"
set terminal pdf enhanced color size 6.0in, 4.5in
set output "W.pdf"
replot
set output
set terminal wxt
	
	ヒストグラムモードにセット.
set style data histogram
以下のコマンドで棒グラフの間隔を変えられる.
set style histogram cluster gap 1
以下のように,using 2:xtic(1)でデータファイルの1列を目を軸目盛りにセットできる.
plot "plot.dat" using 2:xtic(1) title "last year" linecolor rgb "light-blue", \
| Official gnuplot documentation. gnuplot 5.0. Retrieved October 11, 2017, from http://www.gnuplot.info/docs_5.0/gnuplot.pdf | 
名前
Email (※公開されることはありません)
コメント