Мультиплот-бары gnuplot не сгруппированы должным образом - PullRequest
0 голосов
/ 10 октября 2019

Я пытался нарисовать три кластерные гистограммы, используя мультиплот (все они имеют одинаковые оси X и Y). Вот мой сценарий:

#!/usr/bin/gnuplot
reset
set term postscript eps enhanced color font ",10"

outfile = 'all-tau.eps'
set output outfile

MARGINTB_TOP   = "set tmargin at screen 0.95; set bmargin at screen 0.65"
MARGINLR_LEFT  = "set lmargin at screen 0.0; set rmargin at screen 0.33"
MARGINLR_MID  = "set lmargin at screen 0.33; set rmargin at screen 0.66"
MARGINLR_RIGHT  = "set lmargin at screen 0.66; set rmargin at screen 0.99"

FB_TRANSE  = "\"a.dat\""
YAGO_TRANSE  = "\"b.dat\""
LUBM_TRANSE  = "\"c.dat\""

COLPAT1 = "lc rgb \"black\" fs pattern 1"
COLPAT2 = "lc rgb \"black\" fs pattern 2"
COLPAT3 = "lc rgb \"black\" fs pattern 3"
COLPAT4 = "lc rgb \"black\" fs pattern 4"

set multiplot layout 1,3
unset ylabel
set auto x
set yrange[0:100]
set style data histogram
set style histogram cluster gap 1 #title #offset 0,0.30
set style fill pattern border -1
set boxwidth 1.0
set grid ytics lt 2

set lmargin 2
set bmargin 2
set xtics offset graph -0.05, graph -0.1 font ", 10"# rotate by 30 right

unset xlabel
set format y ""
set grid y ls 2
set label "Min Subgraph Size (X-axis) Vs % Reduction (Y-axis)" at screen 0.35,0.97 center front font ", 10"

set key top left outside vertical maxrows 1
set label "LUBM TRANSE" at screen 0.27,0.91 center front font ", 10"
@MARGINLR_LEFT; @MARGINTB_TOP
plot    newhistogram "10", @LUBM_TRANSE  using 2  title col @COLPAT1, '' using 3 title col @COLPAT2, '' using 4:xtic(1) notitle @COLPAT3, '' using 5:xtic(1) notitle @COLPAT4, \
    newhistogram "50", @LUBM_TRANSE  using 6:xtic(1)  notitle @COLPAT1, '' using 7:xtic(1) notitle @COLPAT2, '' using 8:xtic(1) notitle @COLPAT3, '' using 9:xtic(1) notitle @COLPAT4, \
    newhistogram "100", @LUBM_TRANSE  using 10:xtic(1)  notitle @COLPAT1, '' using 11:xtic(1) notitle @COLPAT2, '' using 12:xtic(1) notitle @COLPAT3, '' using 13:xtic(1) notitle @COLPAT4

@MARGINLR_MID; @MARGINTB_TOP
set label "YAGO TRANSE" at screen 0.57,0.91 center front font ", 10"
plot    newhistogram "10", @YAGO_TRANSE  using 2:xtic(1)  notitle @COLPAT1, '' using 3:xtic(1) notitle @COLPAT2, '' using 4:xtic(1) notitle @COLPAT3, '' using 5:xtic(1) notitle @COLPAT4, \
        newhistogram "50", @YAGO_TRANSE  using 6:xtic(1)  notitle @COLPAT1, '' using 7:xtic(1) notitle @COLPAT2, '' using 8:xtic(1) notitle @COLPAT3, '' using 9:xtic(1) notitle @COLPAT4, \
        newhistogram "100", @YAGO_TRANSE  using 10:xtic(1)  notitle @COLPAT1, '' using 11:xtic(1) notitle @COLPAT2, '' using 12:xtic(1) notitle @COLPAT3, '' using 13:xtic(1) notitle @COLPAT4


#set xtics offset 0, graph 0.02 font ", 10"# rotate by 30 right
@MARGINLR_RIGHT; @MARGINTB_TOP
set label "FB15K-237 TRANSE" at screen 0.87,0.91 center front font ", 10"
set key top right outside vertical maxrows 1

plot    newhistogram "10", @FB_TRANSE  using 2:xtic(1)  notitle @COLPAT1, '' using 3:xtic(1) notitle @COLPAT2, '' using 4 title col @COLPAT3, '' using 5 title col @COLPAT4, \
        newhistogram "50", @FB_TRANSE  using 6:xtic(1)  notitle @COLPAT1, '' using 7:xtic(1) notitle @COLPAT2, '' using 8:xtic(1) notitle @COLPAT3, '' using 9:xtic(1) notitle @COLPAT4, \
        newhistogram "100", @FB_TRANSE  using 10:xtic(1)  notitle @COLPAT1, '' using 11:xtic(1) notitle @COLPAT2, '' using 12:xtic(1) notitle @COLPAT3, '' using 13:xtic(1) notitle @COLPAT4

unset multiplot

Файл cat a.dat

Distance Recall(H) Recall(T) %Red(H) %Red(T) Recall(H) Recall(T) %Red(H) %Red(T) Recall(H) Recall(T) %Red(H) %Red(T)
a 75.08 77.78 41.05 18.74 58.71 49.7 52.12 32.45 59.46 49.4 50.92 30.9
d 80.63 51.95 9.05 34.09 69.82 40.09 38.43 35.59 71.47 39.04 33.21 30.97

Файл cat b.dat

Distance Recall(H) Recall(T) %Red(H) %Red(T) Recall(H) Recall(T) %Red(H) %Red(T) Recall(H) Recall(T) %Red(H) %Red(T)
a 81.96 39.38 77.07 78.05 68.54 7.72 81.04 79.59 66.76 6.27 81.26 83.56
d 65.78 31.2 67.4 56.82 55.21 4.34 75.82 75.94 49.27 2.85 75.25 77.72

Файл cat c.dat

Distance Recall(H) Recall(T) %Red(H) %Red(T) Recall(H) Recall(T) %Red(H) %Red(T) Recall(H) Recall(T) %Red(H) %Red(T)
a 30.46 27.17 85.82 88.06 16.91 14.82 85.98 87.39 17.95 12.87 86.91 86.41
d 41.67 35.77 79.1 80.43 15.57 16.55 89.76 92.71 12.25 11.24 91.01 90.3

Я проверил несколько учебных пособий по gnuplot, но ни один из них не объясняет подробно мультиплот (с гистограммами)

Некоторые бары не на своем месте, и легенда не вне , как я и ожидал. Может кто-то здесь указать на ошибку, которую я делаю?

Я прилагаю результаты с gnuplot 5.2 patchlevel 7

misplaced bars in the cluster

...