![尽管我将图表居中,但它的缩进却是向右的](https://linux22.com/image/455193/%E5%B0%BD%E7%AE%A1%E6%88%91%E5%B0%86%E5%9B%BE%E8%A1%A8%E5%B1%85%E4%B8%AD%EF%BC%8C%E4%BD%86%E5%AE%83%E7%9A%84%E7%BC%A9%E8%BF%9B%E5%8D%B4%E6%98%AF%E5%90%91%E5%8F%B3%E7%9A%84.png)
所以我试着画一张 tikz 图片
因此begin{document}
,我写道
\begin{figure}[h!]
\centering
\resizebox{0.4\textwidth}{!}{\input{ball_MSD.tikz}\unskip}
\caption{Mass Spring Damper system at $t=t_1$}
\end{figure}
ball_MSD.tikz
我已经把
\usetikzlibrary{calc,patterns,
decorations.pathmorphing,
decorations.markings}
\begin{tikzpicture}[
force/.style={>=latex,draw=blue,fill=blue},
displacement/.style={>=latex,draw=brown,fill=brown},
plane/.style={draw=black,fill=blue!10},
]
\tikzstyle{spring}=[minimum width = 1cm,decorate,decoration={zigzag, pre length=0.2cm,post length=0.2cm,segment length=3}]
\tikzstyle{damper}=[thick,decoration={markings,mark connection node=dmp,mark=at position 0.5 with
{
\node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum width=0.5cm,minimum height=0.25cm,draw=none] {};
\draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
\draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);
}}, decorate]
\node[name=s,shape=rectangle,fill=black!30, minimum height=1cm, minimum width=2cm] at (0cm,1.5cm) {};
\draw[plane] (-2cm,0) to (2cm,0);
\draw[force,->] (s.center) -- ++(0cm,-2.5cm) node[right, near end] {$F_w=mg$};
\draw[spring] ($(s.south) - (0.75cm,0)$) -- ($(0,0) - (0.75cm,0)$);
\draw[damper] ($(s.south) + (0.75cm,0)$) -- ($(0,0) + (0.75cm,0)$);
\end{tikzpicture}
尽管我已将代码居中,但是却tikzpicture
向右移动,而却caption
没有。
没有错误消息并且我正在使用该类memoir
。