2

When I try to plot this:

  \begin{tikzpicture}
  \begin{axis}[%
  scale=1.5,
  max space between ticks=25, 
  ticklabel style={font=\scriptsize},
  axis lines = middle,
  xmin=-8000, xmax=9000, 
  ymin=-10000, ymax=130000, 
  domain=-8000:9000,         
  grid=both,
  xlabel=$ q $, ylabel=$ R\ C $,
  yticklabel style={
  /pgf/number format/fixed,
  /pgf/number format/fixed zerofill}]
  \path [pattern color=yellow, pattern=north west lines] (axis cs:8000,-10000) -- (axis cs:8000,130000) -- (axis cs:9000,130000) -- (axis cs:9000,-10000) -- (axis cs:8000,-10000);
  \addplot [very thick, blue, smooth] {15*x};
  \addplot [very thick, green, smooth] {5*x+30000};
  \draw [fill=red](axis cs:0,0) circle (2.5pt);
  \draw [fill=red](axis cs:8000,120000) circle (2.5pt);
  \draw [fill=yellow](axis cs:3000,45000) circle (2.5pt) node [below right] {$B.E.P. (3000,45000)$};
  \draw [fill=red](axis cs:0,30000) circle (2.5pt);
  \draw [fill=red](axis cs:-6000,0) circle (2.5pt);
  \draw [thick, red, dashed] (axis cs:8000,130000) -- (axis cs:8000,-10000);
\end{axis}
\end{tikzpicture}

I get this diagram: enter image description here

which has a scientific notation on y-axes, and I don't want it. How can I avoid this lack?

Ignasi
  • 136,588
JJ Henry
  • 403
  • 1
    If not duplicated, at least related: http://tex.stackexchange.com/questions/29926/how-to-prevent-pgfplots-from-using-the-10n-notation-for-axis-ticks/29929#29929 – Ignasi May 07 '15 at 15:52

2 Answers2

2

Use

  scaled y ticks=false,
  yticklabel style=/pgf/number format/fixed,

enter image description here

Code:

\documentclass{standalone}
\usepackage{pgfplots}
\usetikzlibrary{patterns}
\pgfplotsset{compat=1.12}
\begin{document}
  \begin{tikzpicture}
  \begin{axis}[%
  scale=1.5,
  max space between ticks=25, 
  ticklabel style={font=\scriptsize},
  axis lines = middle,
  xmin=-8000, xmax=9000, 
  ymin=-10000, ymax=130000, 
  domain=-8000:9000,         
  grid=both,
  xlabel=$ q $, ylabel=$ R\ C $,
  scaled y ticks=false,
  yticklabel style=/pgf/number format/fixed,
  ]
  \path [pattern color=yellow, pattern=north west lines] (axis cs:8000,-10000) -- (axis cs:8000,130000) -- (axis cs:9000,130000) -- (axis cs:9000,-10000) -- (axis cs:8000,-10000);
  \addplot [very thick, blue, smooth] {15*x};
  \addplot [very thick, green, smooth] {5*x+30000};
  \draw [fill=red](axis cs:0,0) circle (2.5pt);
  \draw [fill=red](axis cs:8000,120000) circle (2.5pt);
  \draw [fill=yellow](axis cs:3000,45000) circle (2.5pt) node [below right] {$B.E.P. (3000,45000)$};
  \draw [fill=red](axis cs:0,30000) circle (2.5pt);
  \draw [fill=red](axis cs:-6000,0) circle (2.5pt);
  \draw [thick, red, dashed] (axis cs:8000,130000) -- (axis cs:8000,-10000);
\end{axis}
\end{tikzpicture}
\end{document}
esdd
  • 85,675
0

Very useful, I also added this:

 yticklabel style={/pgf/number format/fixed,
 /pgf/number format/set thousands separator={\,}}]

cause I find it more reliable to me.

JJ Henry
  • 403
  • 1
    And why did you add it? Why is it more reliable for you? Must that be for others? Please explain better ... – Mensch May 07 '15 at 16:06