data visualization - How to display a stacked barchart in Gnuplot? -
i have data file looks bit this:
a 0.2 0.5 b 0.65 0.8 c 0.4 0.2
i.e., contains 3 columns first column contains labels , other 2 columns float values. columns separated spaces.
i'd plot in way labels appear tics on x-axis while columns plotted 2 differently colored barcharts on top of each other.
how can achieve using gnuplot?
assuming data stored in file 1.dat
, stacked barcharts might generated follows:
set style data histograms set style histogram rowstacked set boxwidth 1 relative set style fill solid 1.0 border -1 set yrange [0:1.5] set datafile separator " " plot '1.dat' using 2 t "var 1", '' using 3:xticlabels(1) t "var 2"
as can see, barcharts no different histograms (at least, within gnuplot). more information can found on gnuplot demo page.
Comments
Post a Comment