GnuPlot: stacked histogram causes hovering bars -


since 2 days trying solve problem. bars of stacked histogram not printed above each other. floating freely around.

secondly, want print 5th xtic-label. using gnuplot v 4.6 patchlevel 6.hovering bars in stacked bargraph

here first data rows (generated libreoffice):

05.06,-,-,1 06.06,3,-,0 07.06,12,-,3 08.06,0,5,4 09.06,7,2,0 10.06,86,2,1 11.06,31,4,1 12.06,17,1,0 01.07,1,7,1 

here comes command set:

gnuplot> set datafile separator ',' gnuplot> set style data histogram gnuplot> set style histogram rowstacked gnuplot> set style fill solid border -1 gnuplot> set xlabel "zeit" gnuplot> set ylabel "anzahl" gnuplot> set yrange [0:250] gnuplot> plot 'test.csv' using 2:xtic(1) title "menge a",''  gnuplot> using 3:xtic(1) title "menge b",'' gnuplot> using 4:xtic(1) title "menge c" 

gnuplot seems confused - column content. set datafile missing '-' doesn't help. need datafile empty fields, like

05.06,,,1 06.06,3,,0 07.06,12,,3 

if cannot libreoffice save data file can use e.g. sed process file on-the-fly:

plot "< sed 's/-//g' test.csv" using 2:xtic(1), '' ... 

(this works if don't have negative values, suppose case).

to second part: instead of xtic(1) can put expression evaluates string inside of xtic, like

xtic(int($0)%5 == 0 ? strcol(1) : '') 

this uses string in first column xticlabel if row number multiple of 5, otherwise empty string:

set datafile separator ',' set style data histogram set style histogram rowstacked set style fill solid border -1 set xlabel "zeit" set ylabel "anzahl" set yrange [0:*] plot '< sed "s/-//g" test.csv' using 2:xtic(int($0)%5 == 1 ? strcol(1) : '') title "menge a",\      '' using 3 title "menge b",\      '' using 4 title "menge c" 

enter image description here


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -