I'd like to achieve that, using pgfplots, an axis is half as high as it is wide (or, in a slightly different scenario, half as high as it "should" be).
Consider this MWE
\documentclass[11pt,a4paper]{article} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{figure} \centering \pgfplotsset{ width = 7cm } \begin{tikzpicture} \matrix{ \begin{axis} [ height = \pgfkeysvalueof{/pgfplots/width}*0.5, xticklabel = \empty ] \addplot coordinates {(1,1) (2,2)}; \end{axis} \\ \begin{axis} \addplot coordinates {(1,2) (2,1)}; \end{axis} \\ }; \end{tikzpicture} \end{figure} \end{document} This works, as long as width is explicitly set outside. How can I make this work, agnostic of whether width is set or not, falling back to \axisdefaultwidth if necessary.


widthis not the actual width, which probably hasn't even been set when the key value forheightis processed.