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.

When I add the log ticks with fixed point option, pgfplots ignores the x-axis range instead of just affecting the y-axis.

without log ticks with fixed point

enter image description here

with log ticks with fixed point

enter image description here

\documentclass{standalone}
\usepackage{pgfplotstable}
    \pgfplotsset{width = 3in, compat = 1.6}

\begin{document}
\begin{tikzpicture}
    \begin{semilogyaxis}[log ticks with fixed point]
        [
            scale only axis,
            xmin=0.4, xmax=2.1,
            ymin=1e-4, ymax=0.1,
        ]
        \addplot {x^3/1e3};
    \end{semilogyaxis}        
\end{tikzpicture}
\end{document}

My goal is to make a plot with y axis in ppm (parts per million). I want to avoid multiplying all the values in the table by 1e6 instead just want to change the labels by multiplying them by 1e6. How can I do this? Right now I am manually changing the tick marks to get right display. I do this by adding ytickten={-4,-3,-2,-1}, yticklabels={100, 1000, 10000, 100000}. How can I make this automatic?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

You have to merge the options into ONE option list:

\begin{semilogyaxis}
    [
        log ticks with fixed point,
        scale only axis,
        xmin=0.4, xmax=2.1,
        ymin=1e-4, ymax=0.1,
    ]

in your example, the second option list is ignored and produces warnings in your .log file.

share|improve this answer
    
thank you, it was silly of me to not realize that. any suggestions on second part of the question for changing the y tick labels? –  mythealias Jan 20 '13 at 19:51
    
Hmm. Take a look at the units library which is shipped with pgfplots. If that is not what you want, you should take a look at section "Tick Scaling - Common Factors In Ticks" in the pgfplots manual. I suppose that might be what you want here. –  Christian Feuersänger Jan 20 '13 at 20:27

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.