1

I want to reproduce this logaritmic scale with this kind of scaling and these ticks, how can I do?

enter image description here

Here it is the code:

\begin{tikzpicture}
            \begin{semilogxaxis}[xmin=1,xmax=7,ymin=0,ymax=1000,
                                 xlabel=$E_\textup{vis}^\textup{obs}$ (MeV),
                                 ylabel=$\frac{dN}{dE_\textup{vis}^\textup{obs}}$, ylabel style={rotate=-90},
                                 width=12cm, height=8cm,
                                 legend style={draw=none},
                                 log ticks with fixed point]

                \addplot [thick,blue]
                file {data/curveIdealNH.txt};
                \addplot [thick,red]
            \end{semilogxaxis}
        \end{tikzpicture}

The datafile is not important, you can plot anything. Thanks so much.

  • Are you plotting anything or you want just the axis? – user11232 Sep 5 '15 at 16:01
  • I'm plotting from a file, I can post the code if necessary but it's trivial – Luigi Pertoldi Sep 5 '15 at 16:05
  • 1
    If you post the minimal code with sample data, it will be useful for us. – user11232 Sep 5 '15 at 16:20
  • Possibly related: tex.stackexchange.com/questions/98695/… – Nathanael Farley Sep 5 '15 at 16:25
  • I don't quite understand the question, what is it you want to produce? The code in your question appears to be fully functional. – Nathanael Farley Sep 5 '15 at 16:46
0

Some thing like this?

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\begin{document}
  \begin{tikzpicture}
            \begin{semilogxaxis}[xmin=1,xmax=10,ymin=0,ymax=1000,
                                 xlabel=$E_\textup{vis}^\textup{obs}$ (MeV),
                                 ylabel=$\frac{dN}{dE_\textup{vis}^\textup{obs}}$,
                                 xtick=\empty,
                                 extra x ticks={2,...,10},
                                 extra x tick labels={2,...,10},
                                 ylabel style={rotate=-90},
                                 width=12cm, height=8cm,
                                 legend style={draw=none},
                                 log ticks with fixed point]

                \addplot [thick,blue] {rnd};
            \end{semilogxaxis}
        \end{tikzpicture}
\end{document}

enter image description here

I have removed xticks and used extra x ticks and labelled them.

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.