Ethan Merritt - 2025-04-16

I agree with you that would make sense from the user's point of view.

Unfortunately I don't immediately see how to make that happen given the way the program is structured. The elements of the using specification are evaluated and applied as the data is read in (datafile.c). This includes xticlabel . The if filter is applied only after the data is passed back to plot2d.c or plot3d.c, but by that time any side effects of evaluating the using specification have already happened, including the creation of a tic label if xticlabel was part of the specification.

A similar problem would arise in cases like this:

  plot FOO using 1 : (ymax = max($2,ymax), $2) with points if (strcol(3) ne "skip")

You might think that this would set ymax to the maximum of only the points that were plotted, but since it is calculated before any filters are applied it will unexpectedly also include the y values of points that were later rejected.

This behavior is correctly described by the first sentence of the documentation for filters. Perhaps that should be expanded to explicitly mention that filters can only accept or reject individual data points, not undo side effects that resulted from reading in the data.

gnuplot> help filter
 Filter operations are applied immediately after reading input data, before
 applying any smoothing or style-specific processing options.