Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I've just started to play with pgfplot. I'm trying to prepare a plot like to following

\begin{figure}[h]
\centering
\begin{tikzpicture}
\begin{axis}[minor tick num=1,  axis x line=middle, axis y
line=middle, xlabel=$k$, ylabel=$\omega$, ymin=0,xmin=-2,ymax=60]
\addplot[blue,domain=0:5, line width=1.5pt] {x^2+25};
\addplot[orange,domain=0:5,line width=1pt]{3*x+22.75};
\addplot[cyan,domain=0:1.5, line width=1pt,dashed]{18.166*x};
\node[coordinate,pin=right:{$v_{\phi}=\frac{\omega}{k}$}]
    at (axis cs:1,17) {};
\node[coordinate,pin=right:{$v_{g}=\frac{d\omega}{dk}$}]
    at (axis cs:2.5,30) {};
\node[coordinate,pin=left:{dispersion relation}]
    at (axis cs:4.5,47) {};
\end{axis}
\end{tikzpicture}
\caption{Wave dispersion relation with phase and group velocity}
\label{fig:2}
\end{figure}

What I would like to do is dropping the x-y tick labels so that we just maintaing the x-y title. How can I obtain it?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Set the xtick and ytick to \empty, i.e.

\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
  minor tick num=1,
  axis x line=middle,
  axis y line=middle,
  xlabel=$k$,
  ylabel=$\omega$,
  ymin=0,xmin=-2,ymax=60,
  xtick=\empty,ytick=\empty]
\addplot[blue,domain=0:5, line width=1.5pt] {x^2+25};
\addplot[orange,domain=0:5,line width=1pt]{3*x+22.75};
\addplot[cyan,domain=0:1.5, line width=1pt,dashed]{18.166*x};
\node[coordinate,pin=right:{$v_{\phi}=\frac{\omega}{k}$}]
    at (axis cs:1,17) {};
\node[coordinate,pin=right:{$v_{g}=\frac{d\omega}{dk}$}]
    at (axis cs:2.5,30) {};
\node[coordinate,pin=left:{dispersion relation}]
    at (axis cs:4.5,47) {};
\end{axis}
\end{tikzpicture}
\end{document}​

enter image description here

share|improve this answer
    
thanks this is exactly what I was looking for –  Nicola Vianello Oct 28 '11 at 9:08
1  
@NicolaVianello You're welcome. By the way, this is mentioned in the manual in section 4.14 Tick options, on page 216. –  Torbjørn T. Oct 28 '11 at 9:18
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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