我绘制的图形有问题,该图形不适合两列纸中的一列,如下图所示,有什么帮助吗?
\begin{figure}{H}
\centering
\begin{tikzpicture}[
simple/.style={draw,text width=1.5cm,align=center,minimum size=1.5em},
node distance=11mm
]
\node (xn) {$x[n]$};
\node[simple,right = of xn] (dft) {DFT};
\node[simple,right = of dft] (log) {log};
\node[simple,right = of log] (idf) {IDFT};
\node[,right = of idf] (cn) {$c[n]$};
\draw[dashed] ([xshift=-10pt,yshift=10pt]dft.north west) rectangle ([xshift=10pt,yshift=-10pt]idf.south east) ;
\draw[->] (xn) -- (dft);
\draw[->] (dft) -- node[auto] {$X[k]$} (log);
\draw[->] (log) -- node[auto] {$\hat{X}[k]$} (idf);
\draw[->] (idf) -- (cn);
\end{tikzpicture}
\caption{Cepstrum representation.}
\end{figure}
答案1
很难给出正确的答案,因为您需要向我们提供用于图片的请求。
你想要什么:节点大小相同?箭头大小相同?虚线矩形大小多少?你想把 $X[k]$ 放在哪里?
如果我想缩放图片,我会尽量避免定位。我认为没有定位会更容易。然后,如果比例更重要,就不可能将 $X[k]$ 放在 (dft) 和 (log) 之间。我将 $X[k]$ 放在这些节点上方。如果保持字体的正常大小,就不可能使用小于 0.6 的系数来缩放图片。
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}[scale=1,
simple/.style={minimum width=8ex, minimum height=2em,draw}
]
\path (0,0) node (xn) {$x[n]$}
++(16ex,0) node[simple] (dft) {DFT}
++(16ex,0) node[simple] (log) {log}
++(16ex,0) node[simple] (idf) {IDFT}
++(16ex,0) node (cn) {$c[n]$};
\draw[->] (xn) -- coordinate (m1) (dft);
\draw[->] (dft) -- node[above=.9em] {$X[k]$} (log);
\draw[->] (log) -- node[above=.9em] {$\hat{X}[k]$} (idf);
\draw[->] (idf) -- coordinate (m2) (cn);
\draw[dashed] ([yshift=-3em]m1) rectangle ([yshift=+3em]m2);
\end{tikzpicture}
\caption{Cepstrum representation.}
\end{figure}
\begin{figure}
\centering
\begin{tikzpicture}[scale=.6,
simple/.style={minimum width=8ex, minimum height=2em,draw}
]
\path (0,0) node (xn) {$x[n]$}
++(16ex,0) node[simple] (dft) {DFT}
++(16ex,0) node[simple] (log) {log}
++(16ex,0) node[simple] (idf) {IDFT}
++(16ex,0) node (cn) {$c[n]$};
\draw[->] (xn) -- coordinate (m1) (dft);
\draw[->] (dft) -- node[above=.9em] {$X[k]$} (log);
\draw[->] (log) -- node[above=.9em] {$\hat{X}[k]$} (idf);
\draw[->] (idf) -- coordinate (m2) (cn);
\draw[dashed] ([yshift=-5em]m1) rectangle ([yshift=+5em]m2);
\end{tikzpicture}
\caption{Cepstrum representation.}
\end{figure}
\end{document}