I would like to change the behavior of pgfplots for the placement of tick scale labels and units.
My desired placement would be or between the last two ticks or in place of the second last tick. For units, this function isn't existing yet, but at least it is possible to define the units separately as part of the \usepgfplotslibrary{units}. Maybe in future this will be possible to define their placement.
For the tick scale labels, placement is possible with every tick scale label/.style={} (s. page 277 in the manual).
For that, I am having two questions.
- Is there a possibility to find the coordinates between the last two ticks (e.g. in style of
(xticklabel cs:...))? - How can I prevent overlapping? If to narrow, the tick scale label shall be positioned in place of the second last tick label. For that, this tick label has to be disabled.
The placement of units is also discussed here without solution.
Edit
Here is an MWE for workaround. \cdot 10^{-2} should be between 1.3 and 1.2. I would like it more with \times in stead of \cdot.
\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[sticky-per]{siunitx}
\usepackage{tikz}
\usepackage{pgfplots}
\SendSettingsToPgf %follow localization
\usepgfplotslibrary{units}
\pgfplotsset{
compat=1.8,
unit marking pre={\!\!/},
unit marking post={},
y label style={rotate=-90},
%scale ticks above exponent = 1, %choose between scaling to one number before comma or to multiples of 3
%scaled ticks=engineering, https://tex.stackexchange.com/a/124268/32245
}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[
yticklabel=$\pgfmathprintnumber{\tick}$,%follow localization
xticklabel=$\pgfmathprintnumber{\tick}$,%follow localization
%Problem here: for `scaled ticks=false` and big numbers, the numbers overlap
xlabel=$\vartheta$, ylabel=$P$,
x unit= \si{\kelvin}, y unit= \si{\watt},
%scaled x ticks=false, %or {base 10:-3}, local manipulation of scaling
%scaled y ticks={base 10:-2}, %or false, local manipulation of scaling
]
\addplot coordinates {
(1000,.01)
(2000,.011)
(3000,.012)
(4000,.013)
};
\end{axis}
\end{tikzpicture}
\caption{Loss $P$ over temperature $\vartheta$}
\end{figure}
\end{document}
Some extras coming up when seeing my result:
- Why isn't there a
10^3on the x axis? - This x tick scale label would be a candidate to be positioned on the 3,500 tick
- Possibility to move units to the coordinates I am searching in this post. E.g.
\si{\kelvin}in place of the 3,500 tick - Parsing all numbers in ticks in respect to the
siunitxlocalization

