While the examples demonstrate many of the available features, it’s not clear what some of the specific options do. You could read the documentation, but who has time for that? Some of us are just trying to create really simple histograms and don’t need to master the nuances of gnuplot.
Here’s my sample data,
colors.data, a series of attributes and a value associates with each attribute:
#Color Count Red 45 Orange 17 Yellow 92 Green 262 Blue 129 Purple 80
Set the style to histograms and plot the datafile:
gnuplot> set style data histograms gnuplot> plot './colors.data' using 2:xtic(1)
plot command above indicates that were are plotting the data from column 2, and we are using column 1 for the xtic labels (the x-axis item markers).
In the resulting histogram, the title says
'color.data' using using 2:xtic(1) which is not particularly meaningful. You can change this by including a title:
gnuplot> plot 'colors.data' using 2:xtic(1) title 'Values by Color'
That’s it! Here’s the result:
I admit, the hollow bars were bothering me, so I make them solid:
gnuplot> set style fill solid
The purple color looked great, but if you’re planning to print something in black-and-white you might want to change the color as well:
gnuplot> plot './colors.data' using 2:xtic(1) linecolor 'black' title 'Values by Color'