gnuplot: バーの上に値を追加

gnuplot: バーの上に値を追加

私のスクリプトは、入力データファイルの3番目と5番目の列からデータを取得し、5番目の列の値が0.05より大きい行のみを考慮して棒グラフを作成します。

cat <<EOS | gnuplot > graph.png
set term pngcairo size 800,600
set xtics noenhanced
set xlabel "Fraction, %"
set ylabel "H-bond donor, residue"
set key off
set style fill solid 0.5
set boxwidth 0.9
plot "<awk 'NR == 1 || \$5 > 0.05' $file" using 0:5:xtic(3) with boxes
EOS

プロットの各バーの上にあるY(Frac)に対応する値を表すように、gnuplotプロット関数を変更する必要があります。 1:2とタグを使って以下を追加してみました。

plot "<awk 'NR == 1 || \$5 > 0.05' $file" using 0:5:xtic(3) with boxes,\
     "<awk 'NR == 1 || \$5 > 0.05' $file" using 1:2:2 with labels

ベストアンサー1

おすすめ記事