I’ve thought about adding these for a while, but had no specific need for them.
Finally, somebody asked for it, and I wrote the code. Now that I can, I will
probably use these all the time. The new capability can override the usual
numerical tic labels on the x axis, and instead use text from a column in the
The most obvious use case is labelled bar graphs:
echo "# label value aaa 2 bbb 3 ccc 5 ddd 2" | feedgnuplot --vnl --xticlabels --with 'boxes fill solid border lt -1' --ymin 0 --unset grid
But the usage is completely generic. All
--xticlabels does, is to accept a
data column as labels for the x-axis tics. Everything else that’s supported by
gnuplot works as before. For instance, I can give a domain,
and use a style that takes
y values and a color:
echo "# x label y color 5 aaa 2 1 6 bbb 3 2 10 ccc 5 4 11 ddd 2 1" | feedgnuplot --vnl --domain --xticlabels --tuplesizeall 3 --with 'points pt 7 ps 2 palette' --xmin 4 --xmax 12 --ymin 0 --ymax 6 --unset grid
And we can use
gnuplot‘s support for clustered histograms:
echo "# x label a b 5 aaa 2 1 6 bbb 3 2 10 ccc 5 4 11 ddd 2 1" | vnl-filter -p label,a,b | feedgnuplot --vnl --xticlabels --set 'style data histogram' --set 'style histogram cluster gap 2' --set 'style fill solid border lt -1' --autolegend --ymin 0 --unset grid
Or we can stack the bars on top of one another:
echo "# x label a b 5 aaa 2 1 6 bbb 3 2 10 ccc 5 4 11 ddd 2 1" | vnl-filter -p label,a,b | feedgnuplot --vnl --xticlabels --set 'style data histogram' --set 'style histogram rowstacked' --set 'boxwidth 0.8' --set 'style fill solid border lt -1' --autolegend --ymin 0 --unset grid
gnuplot‘s “row stacking”. It also supports “column stacking”, which
effectively transposes the data, and it’s not obvious to me that makes sense in
the context of
feedgnuplot. Similarly, it can label
z axes; I
can’t think of a specific use case, so I don’t have a realistic usage in mind,
and I don’t support that yet. If anybody can think of a use case, email me.
Notes and limitations:
- Since with
--domainyou can pass in both an
xvalue and a tic label, it
is possible to give it conflicting tic labels for the same
gnuplotitself has this problem too, and it just takes the last label it has
for a given
x. This is probably good-enough.
feedgnuplotuses whitespace-separated columns with no escape mechanism, so
the field labels cannot have whitespace in it. Fixing this is probably not
worth the effort.
- These tic labels do not count towards the
- I really need to add a similar feature to
gnuplotlib. This will happen when
I need it or when somebody asks for it, whichever comes first.