I've got data that I want to plot in gnuplot that looks something like this:
1.08 1 4.8
1.53 2 5.9
2.11 3 5.1
2.60 4 6.0
Not that it's terribly important, the first column is the running time of a genetic algorithm, the second column is the generation number, and the third is average fitness.
If I plot it using plot datafile.dat using 1:3 with lines
it looks fine, with tics appropriately spaced. However, while I want the x-tics to be labelled with the time, I want the x2-tics to be labelled with the generation number. This is easy to do with plot datafile.dat using 1:3:x2ticlabels(2) with lines
, but for the x2-axis it adds a tick for every single line in the data file, instead of automatically choosing an appropriate number of tics.
My full data file has thousands of entries, which results in a solid black line at the top of the graph where the tics would be spaced, and a larger solid black line above where the labels would be placed. Even if I try to manually tell gnuplot how often to place tics on the graph using set x2tics 100
it still displays them for every entry. Is there a way to fix this? Obviously I'd prefer which tics are shown to be automatically chosen, but if I have to do it manually that's fine. The full gnuplot config file is pretty basic, just:
set logscale y 10
set x2tics
plot datafile.dat using 1:3:x2ticlabels(2) with lines