7

To remove the ticks of a figure (and not the tick labels), I could only find the opacity trick, that I find odd. Is there any better way?

\documentclass[12pt]{book}
\usepackage{tikz,pgfplots}
\begin{document}
\begin{tikzpicture}
\pgfplotsset{minor grid style={color=black!20,line width=0.25pt},major grid style={color=black!30,line width=0.35pt},tick style={opacity=0}}
\begin{semilogyaxis}[grid=both,scale only axis,width=7cm,height=5cm,xmin=0,xmax=2.4,ymin=1e-008,ymax=0.01,,axis background/.style={fill=black!3},xlabel=$\omega$,ylabel=$|X_5(\omega)|$,xtick={0,0.4,0.8,1.2,1.6,2,2.4},xticklabels={$0$,$$,$50$,$$,$100$,$$,$150$},ytickten={-8,-7,-6,-5,-4,-3,-2},yticklabels={$10^{-8}$,$$,$10^{-6}$,$$,$10^{-4}$,$$,$10^{-2}$}]
\addplot[color=blue,solid]
coordinates{(0,6.09811e-005)(2.4,6.10675e-003)};
\end{semilogyaxis}
\end{tikzpicture}
\end{document}
5

You could also use tick style={draw=none}. This has the added flexibility in that you could change the color of the ticks with something like tick style={draw=red}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.