I am preparing a talk using plots generated in pgfplots
' axis
-environment. I want the plots' axes to be of the exact same size and position. Unfortunately, plots with different axis- and plot-labels differ in size and produce small "jumps" when flipping through the pages of the presentation. In the code below, I illustrate the problem. The axes have the same size, but due to the different labels, their horizontal position shifts. If one comments the varwidth
option, one can see, that the same thing happens in the vertical direction.
\documentclass[crop,10pt,
varwidth=250pt
]{standalone}
\usepackage[english]{babel}
\usepackage{pgfplots}
\pgfplotsset{compat=1.9}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=200pt,
heigth=200pt,
xmin=0,xmax=1,ymin=0,ymax=1,
xlabel=xlabel,
ylabel=ylabel,
scale only axis
]
\addplot coordinates{
(0.1,0.1)
(0.9,0.9)
};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[
width=200pt,
heigth=200pt,
xmin=0,xmax=100,ymin=0,ymax=100,
xlabel=x$_l^a$bel,
ylabel=y$_l^a$bel,
scale only axis,
]
\addplot coordinates{
(10,10)
(90,90)
};
\end{axis}
\end{tikzpicture}
\end{document}
Is there a way to produce separate plots with axes of exact same size and position?
width
orheight
of the plots, you'll then probably also want to usescale only axis=true
to apply this width and height to the rectangle. For more information see thepgfplots
manual (section 4.10 forpgfplots
version 1.10).xmin
,xmax
,ymin
andymax
. Please add your (minimal working) example to the post. It helps solvers to get into it.width
andhight
as well as thex/y min/max
options, the problem comes from the different labels which lead to a different overall size of the graphics and a different position of the axes.