# pgfplots: Forcing Scientific Notation for y Axis

I wish to force PGFPlots to use the same scientific notation exponent for all y tick labels, with the exponent placed above the graph, turning this style

into this style

I'm currently using scaled y ticks = true with no effect. I'm aware I could use scaled y ticks=base 10:2 to manually specify to use 1E2, but I'm looking for a more general solution.

• Can you post the script you used to generate the first graph above? – caverac May 11 '18 at 14:56
• Is your problem solved? If not then please at least leave a feedback. – Dr. Manuel Kuehner May 11 '18 at 21:23

I assume that you are looking for y tick label style={/pgf/number format/sci}. See also Chapter 4.13.1 (Frequently Used Number Printing Settings) in the current pgfplots manual ( I find it a bit difficult for beginners since this is tikz stuff as I understand it and not pgfplots -specific), see also* manual of pgfplotstable Chapter 2.7 (Number Formatting Options).

I do not know how to get the common mantissa sepearte from the ticks and at the top of the axis: Any experts here?

\documentclass{article}
\usepackage{pgfplots}
\begin{document}

% Based on http://pgfplots.sourceforge.net/gallery.html
\begin{tikzpicture}
\begin{axis}[
xlabel=$x$,
ylabel={$f(x) = x^2 - x +4$},
y tick label style={/pgf/number format/sci},
]
% use TeX as calculator:
\end{axis}
\end{tikzpicture}

\end{document}


*"The options related to number printing as such are described in all detail in the manual for PgfplotsTable, which comes with pgfplots."