TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know how to get a grid in pgfplots as shown below, but how can I get additionally a subgrid without labels?

\documentclass{article}

\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
   \begin{axis}[grid=both,no markers,samples=100]
      \addplot {sin(deg(x))};
   \end{axis}
\end{tikzpicture}

\end{document}

Output:

output

share|improve this question
up vote 5 down vote accepted

You can use grid=both and minor tick num=<number>; then (if you want to) you can set the length for the minor ticks to 0pt:

\documentclass{article}

\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
   \begin{axis}[
  grid=both,
  no markers,
  samples=100,
  minor tick num=2,
  every minor tick/.style={minor tick length=0pt}]
      \addplot {sin(deg(x))};
   \end{axis}
\end{tikzpicture}

\end{document}

enter image description here

share|improve this answer

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.