I have frequently the problem that too many data points are available for the x axis, I want to show them all in the actual plot, but I would like to show only a subset of the ticks. For instance, if I have values 2^3,..,2^32 in my x axis, I would like to display only 2^3, 2^5, 2^7 and so on (show one, skip one)
An example output is here:
The figure code would be:
\begin{figure}[!htb]
\centering
\begin{tabular}{rl}
\hspace{-5mm}
\begin{tikzpicture}
\begin{axis}[title = GB/s, xtick=data, xmode=log,log basis x={2},
width=8cm, height=5.5cm, ymajorgrids,legend columns=-1,
legend entries={MinMax UT, MinMax SSE, MinMax AVX2},
legend to name=named, legend style = {font = {\sffamily\scriptsize}} ]
\pgfplotstableread{benchmarks/minmaxexcess/data.dat} \tableRAW
\foreach \p in {1,3,5} {\addplot table [y index = \p] from \tableRAW;}
\end{axis}
\end{tikzpicture}%
\hspace{-4mm}
&
\begin{tikzpicture}
\begin{axis}[title = Average CM/op, ymode=log, xtick=data, xmode=log,log basis x={2},
width=8cm, height=5.5cm, ymajorgrids, ]
\pgfplotstableread{benchmarks/minmaxexcess/data.dat} \tableRAW
\foreach \p in {2,4,6} {\addplot table [y index = \p] from \tableRAW;}
\end{axis}
\end{tikzpicture}%
\\
\multicolumn{2}{c}{\ref{named}}\\
\end{tabular}
\vspace{-3mm}
\caption{Average values obtained for extrema computation experiment.}
\label{fig:extrema}
\end{figure}
Best Answer
You could give the xticks directly. The manual reveals that one can use the
1,3,...,19
writing style (as it is used in aforeach
statement). A minimal example without data would beThe
xtickten
option is used to provide the ticks instead ofxtick
because I gave exponents instead of the full value.Btw: Your MWE is still not very useful because we don't have your data files. A good idea should be one file that one can copy and compile without further alteration.