Quantcast
Channel: Automatically put PGFPlots xtick scale label in x axis label - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 3

Answer by Budo Zindovic for Automatically put PGFPlots xtick scale label in x axis label

$
0
0

It seems that the best solution is to remove xlabel and use xscale label instead. My solution is posted below:

\documentclass{article}\usepackage{pgfplots}\pgfplotsset{compat=1.14}\begin{document}    \begin{tikzpicture}    \begin{axis}[        scaled x ticks=true,        scaled y ticks = false,        y tick label style={/pgf/number format/fixed},        xtick scale label code/.code={$x$ $ ( 10^{#1}$ m)},        xlabel = {},        ylabel = {$ y $},    ]    \addplot[line width=3pt] coordinates {(0.0,0.0)(100,1)(400,2)(10000,0)};    \end{axis}    \end{tikzpicture}\end{document}

Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>