我有两个图,每个都在一个小页面中,因此它们可以并排显示。左侧图比我想要的要小得多。我该如何修复它?
\begin{frame}[t,fragile]{CI construction - example}
\begin{minipage}{.4\textwidth}
\begin{center}
\begin{tikzpicture}
\begin{axis}[
height=1\linewidth,
width=1\linewidth,
xlabel=$\hhest$,
ylabel=$\Pr(\hhest)$,
ticklabel style = {font=\footnotesize},
label style = {font=\footnotesize},
title style = {font=\footnotesize},
title={$\hh=0.2$},
ymin=0,
ymax=0.15,
ytick={0,0.05,0.1,0.15},
yticklabels={0,0.05,0.1,0.15}
]
\addplot[name path=f, red] table[x=h2, y=0.200] {nfbc_h2_distribution.dat};
\path[name path=axis] (axis cs:0,0) -- (axis cs:1,0);
\addplot [
thick,
color=red,
fill=red,
fill opacity=0.05
]
fill between[
of=f and axis,
soft clip={domain=0:0.15},
];
\addplot[mark=none, dash pattern=on 0.5pt off 0.5pt , black] coordinates {(0,0) (0, 0.15)};
\addplot[mark=none, dash pattern=on 0.5pt off 0.5pt, black] coordinates {(0.15,0) (0.15, 0.15)};
\end{axis}
\end{tikzpicture}
\\
{\small $A_{0.2} = [0, 0.15]$}
\end{center}
\end{minipage}\hspace{0cm}%
\begin{minipage}{.45\textwidth}
\begin{tikzpicture}
\begin{axis}[
height=1\linewidth,
width=1\linewidth,
xlabel=$\hhest$,
ylabel=$\hh$,
ticklabel style = {font=\footnotesize},
label style = {font=\footnotesize},
title style = {font=\footnotesize},
xmin=0, xmax=1, ymin=0, ymax=1, ytick={0,0.1,0.2,0.3,1}, yticklabels={0,0.1,0.2,0.3,1},
]
\addplot[mark=none, red, thick] coordinates {(0,0.1) (0.15, 0.1)};
\addplot[mark=none, red, thick] coordinates {(0,0.2) (0.15, 0.2)};
\end{axis}
\end{tikzpicture}
\end{minipage}
\end{frame}
我得到:
答案1
您确实应该提供 MWE。
我已经尝试过,在我看来,如果将轴的长度设置为绝对值\begin{axis}
,您将获得相同大小的绘图区域:
\begin{axis}[height=4cm, width=4cm, %...