-1

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

enter image description here

into this style

enter image description here

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.

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

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$},
        % Added
        y tick label style={/pgf/number format/sci},
    ]
    % use TeX as calculator:
    \addplot {x^2 - x +4};
    \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."

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.