子標題之間的水平間距

子標題之間的水平間距

我有下一個圖形

在此輸入影像描述

如您所看到的,子標題(b)並未以相應的子圖為中心,例如(a)。如果我增加價值,[.51\linewidth]就會發生不需要的事情。我使用subcaptionpackage with 是memoir因為 s 的本機回憶錄工具subfigure顯示右對齊問題。上圖的程式碼是:

\documentclass[11pt]{memoir}

\setstocksize{23cm}{15.9cm} 
\settrimmedsize{23cm}{15.9cm}{*} 
\settrims{0pt}{0pt} 
\settypeblocksize{17.8cm}{11.3cm}{*} 
\setlrmargins{2.3cm}{*}{*} 
\setulmargins{6.4\onelineskip}{*}{*} 
\setheadfoot{1.18\onelineskip}{\onelineskip} 
\setheaderspaces{4.1\onelineskip}{*}{*} 
\checkandfixthelayout[lines] 

\usepackage{amsmath,amssymb,amsthm}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{subcaption}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=1.10}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{arrows}
\pgfplotsset{
/pgfplots/area style/.style={%
area cycle list,
area legend,
axis on top,
}}

\begin{document}

\blindtext\blindtext

\begin{figure}[b]
%\centering
\subcaptionbox{A cat\label{cat}}{\begin{tikzpicture}[scale=0.71]
 \begin{axis}[axis equal,axis on top,axis lines=center,enlargelimits=false,xlabel=$x(t)$,ylabel=$y(t)$,xmax=2.5,xmin=-2.2,ymax=2.5,ymin=-2.2,area legend,xtick=\empty,ytick= \empty %,legend entries={$\Ran f$}]
\addplot[draw=blue!30!white,fill=blue!30!white,
domain=-2:2,samples=120] {sqrt(4-x^2)};
%\addlegendimage{fill=blue!30!white,area legend}
%\addlegendentry{$\Ran f$}
\addplot[draw=blue!30!white,fill=blue!30!white,
domain=-2:2,samples=120] {-sqrt(4-x^2)};

\addplot[white,fill,
domain=-1:1,samples=120] {sqrt(1-x^2)};
\addplot[white,fill,
domain=-1:1,samples=120] {-sqrt(1-x^2)};
%\node at (380,170) {$x'(t)$};
%\node at (20,170) {$y'(t)$};
\end{axis}
\end{tikzpicture}}
\subcaptionbox{An elephant\label{elephant}}[.51\linewidth]
{\begin{tikzpicture}[scale=0.71,/pgf/declare function={f=1/x;}]
\begin{axis}[axis x line=center,axis y line=center,xtick=\empty,ytick=  \empty,xlabel=$x(t)$,
ylabel=$y(t)$,] 
\addplot [red!30!white,name path=f,domain=-3:3, samples=60] {f};

\path[name path=axis] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},0) --  (axis cs:\pgfkeysvalueof{/pgfplots/xmax},0);

\addplot[red!30!white] fill between[of=f and axis];
\end{axis}
\end{tikzpicture}}
\caption{Two animals}\label{animals}
\end{figure}
\end{document}

我如何控制它?

答案1

而不是透過傳遞scale=0.71tikzpicture其傳遞給axis選項。我還添加了ylabel style={anchor=west}將 y 標籤放小一點的功能。

\documentclass[11pt]{memoir}

\setstocksize{23cm}{15.9cm}
\settrimmedsize{23cm}{15.9cm}{*}
\settrims{0pt}{0pt}
\settypeblocksize{17.8cm}{11.3cm}{*}
\setlrmargins{2.3cm}{*}{*}
\setulmargins{6.4\onelineskip}{*}{*}
\setheadfoot{1.18\onelineskip}{\onelineskip}
\setheaderspaces{4.1\onelineskip}{*}{*}
\checkandfixthelayout[lines]

\usepackage{amsmath,amssymb,amsthm}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{subcaption}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=1.10}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{arrows}
\pgfplotsset{
/pgfplots/area style/.style={%
area cycle list,
area legend,
axis on top,
}}

\begin{document}

\blindtext\blindtext

\begin{figure}[b]
%\centering
\subcaptionbox{A cat\label{cat}}{\begin{tikzpicture}
 \begin{axis}[scale=0.71,axis equal,axis on top,axis lines=center,enlargelimits=false,xlabel=$x(t)$,ylabel=$y(t)$,xmax=2.5,xmin=-2.2,ymax=2.5,ymin=-2.2,area legend,xtick=\empty,ytick= \empty,
ylabel style={anchor=west} %,legend entries={$\Ran f$}
]
\addplot[draw=blue!30!white,fill=blue!30!white,
domain=-2:2,samples=120] {sqrt(4-x^2)};
%\addlegendimage{fill=blue!30!white,area legend}
%\addlegendentry{$\Ran f$}
\addplot[draw=blue!30!white,fill=blue!30!white,
domain=-2:2,samples=120] {-sqrt(4-x^2)};

\addplot[white,fill,
domain=-1:1,samples=120] {sqrt(1-x^2)};
\addplot[white,fill,
domain=-1:1,samples=120] {-sqrt(1-x^2)};
%\node at (380,170) {$x'(t)$};
%\node at (20,170) {$y'(t)$};
\end{axis}
\end{tikzpicture}}
\subcaptionbox{An elephant\label{elephant}}[.51\linewidth]
{\begin{tikzpicture}[/pgf/declare function={f=1/x;}]
\begin{axis}[scale=0.71,axis x line=center,axis y line=center,xtick=\empty,ytick=  \empty,xlabel=$x(t)$,
ylabel=$y(t)$,,
ylabel style={anchor=west}]
\addplot [red!30!white,name path=f,domain=-3:3, samples=60] {f};

\path[name path=axis] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},0) --  (axis cs:\pgfkeysvalueof{/pgfplots/xmax},0);

\addplot[red!30!white] fill between[of=f and axis];
\end{axis}
\end{tikzpicture}}
\caption{Two animals}\label{animals}
\end{figure}
\end{document}

在此輸入影像描述

相關內容