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 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
add comment

1 Answer 1

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
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.