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 would like to add only a grid on the y-axis. Here is my MWE:

\documentclass{scrreprt}
\usepackage{tikz, pgfplots}

\begin{document}
\begin{tikzpicture}
  \begin{semilogyaxis}[
    /pgf/number format/.cd,
    use comma,
    1000 sep={},
    enlargelimits = auto,
    width = 0.49\textwidth,
    ylabel = {ICumCDP},
    ymin = 1E-8,
    ymax = 1E-4,
    xlabel = {Jahr},
    xtick = {2012,2011,2010,2009,2008}
  ]
  \addplot[only marks, color=blue] coordinates {
  (2008, 3.52e-07)
  (2009, 3.02e-07)
  (2010, 1.92e-07)
  (2011, 3.68e-07)
  (2012, 1.36e-06)
};
  \end{semilogyaxis}
\end{tikzpicture}
\hfill
\begin{tikzpicture}
  \begin{semilogyaxis}[
    /pgf/number format/.cd,
    use comma,
    1000 sep={},
    enlargelimits = auto,
    width = 0.49\textwidth,
    ylabel = {CCDFmax},
    ymin = 1E-8,
    ymax = 1E-4,
    yticklabel pos=right,
    ylabel near ticks,
    xlabel = {Jahr},
    xtick = {2008,2009,2010,2011,2012}
  ]
  \addplot[only marks, color=red] coordinates {
  (2008, 8.46e-06)
  (2009, 4.56e-06)
  (2010, 4.96e-06)
  (2011, 4.96e-06)
  (2012, 3.02e-05)
};
  \end{semilogyaxis}
\end{tikzpicture}

\end{document} 
share|improve this question
up vote 16 down vote accepted

You can activate the horizontal grid using the key ymajorgrids:

share|improve this answer
    
Thanks, it's really easy. Thanks !!! – Dzaic Feb 5 '13 at 10:56

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.