|
# The same as above, with manual filtering
# Note that you have to specify the factors and you have to set the xtics as well.
# However, you have greater control over the appearance of the plot
# e.g. the order of the boxplots, their colors, the tic labels
# The previous form is intended for interactive usage while the latter form is better suited
# to creating publication-ready graphs.
# Note: we turn off autoscaling for the last two categories so that outliers do not
# expand the range on y even though they are not shown.
factors = "Nuclear Coal Gas Oil Hydroelectric Renewable"
NF = words(factors)
set xtic ("" 1)
set for [i=1:NF] xtics add (word(factors,i) i)
set style boxplot nooutliers
set style boxplot medianlinewidth 2.5
t(x) = x/1.e6
filter(col, factor_col, level) = (strcol(factor_col) eq word(factors, level)) ? t(column(col)) : 1/0
set title "Distribution of energy usage explicitly ordered by name of energy source\n"
plot for [i=1:NF-2] 'energy_circles.dat' using (i):(filter(8, 4, i)), \
for [i=NF-1:NF] 'energy_circles.dat' using (i):(filter(8, 4, i)) noauto
Click here for minimal script to generate this plot
|