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.

A chart with data in the range of 200,000 and small difference between max and min values, will be assigned a 10^5 multiplier to the entire axis. This results in the ticks becoming meaningless, since all become 2.

Example:-

\begin{tikzpicture}
\begin{axis}
  \addplot coordinates {
  (100,200001)
  (200,200003)
  (300,200005)
  };    
\end{axis}
\end{tikzpicture}

When this is plotted the y-axis has 5 ticks, all of which are 2. The y-axis has a multiplier of 10^5. This has effectively removed all information from the graph.

I may use the below to set the explicit value of the tick values but this does not implement change in the display "style" of the axis ticks.

ytick = {200000, 200005, 200010}

I have also tried increasing the precision of the tick label to 5. However this only results in the graph showing labels such as 2.00000, 2.00005, 2.00010 with a 10^5 axis multiplier.

yticklabel style={precision = 5,}

My question is "How do I remove/change this 10^5 multiplier, such that the y-axis ticks are displayed in the form 200000, 200005, 200010.

share|improve this question
1  
So is your question "How do you remove the axis multiplier"? –  Seamus Jan 27 '11 at 15:04
    
Perhaps we could have a minimal example? –  Joseph Wright Jan 27 '11 at 20:26
    
Yes, my question is how can this axis multiplier be removed. An example, simply plot the following:- \addplot coordinates { (100,200001) (200,200003) (300,200005) }; –  Phil Jan 28 '11 at 9:58
    
Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. –  Papiro Apr 15 '13 at 11:16
add comment

1 Answer 1

up vote 23 down vote accepted

You can disable the common scaling factor using scaled y ticks = false in the axis options. This will lead to each individual tick label being displayed in scientific notation, which you can suppress by also using y tick label style={/pgf/number format/fixed} (see p. 543 of the PGF Manual for the other options of formatting the numbers).

\documentclass{minimal}
\usepackage{pgfplots}


\begin{document}
\begin{tikzpicture}
\begin{axis}[
      scaled y ticks = false,
      y tick label style={/pgf/number format/fixed,
      /pgf/number format/1000 sep = \thinspace % Optional if you want to replace comma as the 1000 separator 
      }]
  \addplot coordinates {
  (100,200001)
  (200,200003)
  (300,200005)
  };    
\end{axis}
\end{tikzpicture}

\end{document}

Unscaled y axis

share|improve this answer
1  
was just about to post the same...:-) –  Yossi Farjoun Jan 28 '11 at 11:27
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.