1

I've this problem with tikz package. I'm creating a plot in the x-range [0; 10000] (in my real plot, up to 100000) but the xticklabels are in the form [0, 0.2, 0.4, 0.6, 0.8, 1] and at the end of the axis there is 10^4. I'd like to get the xticklabels in the form [0, 2000, 4000, 6000, 8000, 10000]. Can anyone help me? Thanks in advance.

    \documentclass[a5paper]{article}
    \usepackage{tikz,pgfplots,amsmath} 
    \pagestyle{empty}
    \begin{document}
    \begin{tikzpicture}
    \begin{axis}[%
    width=8cm,
    height=5cm,
    scale only axis,
    xmin=0,
    xmax=10000,
    xlabel={f [Hz]},
    xmajorgrids,
    xtick={0,2000,4000,6000,8000,10000},
    xticklabel=\pgfmathprintnumber{\tick}, 
    ymin=-50,
    ymax=150,
    ylabel={k [1/m]},
    ymajorgrids,
    ytick={-50,0,50,100,150},
    yticklabels={ $-50$, $ 0 $, $50$, $100$, $150$},
    ]
    \addplot [
    color=blue,
    solid,
    line width=1.0pt,
    forget plot
    ]
    table[row sep=crcr]{
    1 0.00124080134369962\\
    11.000900090009 0.01365024490508\\
    1941.17461746175 2.40866649072482\\
    10001.900090009 12.4105748087962\\
    };
    \end{axis}
    \end{tikzpicture}%
    \end{document}
  • Hi, welcome to TeX.sx. See if http://tex.stackexchange.com/questions/9803/how-do-you-remove-the-axis-multiplier/9847#9847 helps. – Torbjørn T. Jan 07 '14 at 09:24
  • Glad I (or rather, Jake) could help. This question will probably be closed soon then, that is 'standard procedure' for duplicate questions. – Torbjørn T. Jan 07 '14 at 09:39
  • Jake it works, but since my plot is up to 100000, at the end there is 10^5 and not 100000. Any tip? – vincidale85 Jan 07 '14 at 10:26
  • Did you add y tick label style={/pgf/number format/fixed} from his answer as well? If it doesn't work, please edit your example code, and we could reopen the question if necessary. – Torbjørn T. Jan 07 '14 at 10:44

0 Answers0