-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange interaction between "fill between", "transform shape" and label positioning. #375
Comments
Probably, coordinate parser is not taking scaling into account. Use explicitly relative axis coordinate system every axis x label/.append style = {at={(rel axis cs:1.0, -0.2)}, }, |
Ah, ok. That way it works. Thanks for the workaround! |
I agree with @ilayn. However, one lesson I learnt is to never add transformations to the ambient \documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}\pgfplotsset{compat=1.17}
\usepgfplotslibrary{fillbetween}
\usepackage{siunitx}
\begin{document}
\begin{tikzpicture}
\begin{axis}[scale=0.6,
nodes={scale=0.6},
width=6cm, height=6cm,
xmin=350, xmax=1100,
domain=300:1000, samples=100,
ymin=0, ymax=1,
axis x line = center,
axis y line = center,
enlarge x limits,
enlarge y limits,
xlabel = {$\lambda$~(\si{\nm})},
every axis x label/.append style = {at={(1.0, -0.2)}, },
ylabel = {$\xi_r$},
legend style = {nodes={right, font=\scriptsize}},
legend pos = north east,
clip mode = individual,
]
\addplot [ultra thick, green!50!black, name path=A, domain=450:800] {exp(-(x-600)/400*(x-600)/100)};
\path [name path=B] (450,0) -- (800,0);
\addplot [green] fill between [of=A and B];
\end{axis}
\end{tikzpicture}
\end{document} |
Consider that code:
it gives the expected:
(Look at the
x label
position). If I uncomment the last line in the axis:then the output is:
Notice how the labels moves.
This does not happen if I comment the
scale=0.6, transform shape
option.The text was updated successfully, but these errors were encountered: