0
votes

gnuplot will only plot the data point 95 when plotting the following data:

l1 l2 l3 l4 l5
108 108 108 108 108
108 108 108 108 108
108 108 108 108 108
108 108 108 108 108
108 108 108 95 108

Strangely, when I remove the first two data lines, all data points will be plotted.

The code I am using is

file = 'xxx'
header = system('head -1 '.file);
N = words(header)
set xtics ('' 1)
set xtics ('' 1)
set for [i=1:N] xtics add (word(header, i) i)
set style data boxplot
unset key
plot for [i=1:N] file using (i):i

and it worked quite well for many other data series.

Thanks a lot in advance!

2

2 Answers

3
votes

Because of the boxplot style, your values are being plotted as lines. These lines lie at y = 108 which also happens to be the position of the upper edge of the graph unless you use set yrange explicitly. Therefore your graph edges are hiding your data. For instance, using set yrange [*:109] will allow you to see your values:

enter image description here

If you want automatic ways to set the yrange you can for instance use stats to get the max and min y values among your data and then make sure your yrange emcompasses a wider range of values.

0
votes

Try set datafile commentschars 'l' to skip the first line.

The set datafile commentschars command allows you to tell gnuplot what characters are used in a data file to denote comments. Gnuplot will ignore rest of the line behind the specified characters if either of them is the first non-blank character on the line.

Type help commentschars in the gnuplot prompt for more information.