为什么变换画布会随着标题的改变而改变?

为什么变换画布会随着标题的改变而改变?

我这里有一个相当大的 tikz 图:

\documentclass[12pt]{amsart}
\usepackage[all,cmtip]{xy}
\usepackage{rotating, tikz}
\usetikzlibrary{matrix,arrows}

\title{None}%

\begin{document}

\begin{sidewaysfigure}[p]
\vspace*{350pt}
\hspace{50pt}
\begin{tikzpicture} [description/.style={fill=white,inner sep=2pt}]
    \matrix (m) [matrix of math nodes, row sep=31pt,
    column sep=40pt, text height=1.5ex, text depth=0.25ex]
    { \\ \\ \\ \underset{v_0}{\bullet} & \underset{v_1}{\bullet} & \underset{v_2}{\bullet} & \underset{v_3}{\bullet} & \cdots & \underset{v_{\lambda - 3}}{\bullet} & \underset{v_{\lambda - 2}}{\bullet} & \underset{v_{\lambda - 1}}{\bullet} & \underset{v_\lambda}{\bullet} \\ \\ \\ \\ \\ \\ \\ \\ \underset{\hat v_0}{\bullet} & \underset{\hat v_1}{\bullet} & \underset{\hat v_2}{\bullet} & \underset{\hat v_3}{\bullet} & \cdots & \underset{\hat v_{\lambda - 3}}{\bullet} & \underset{\hat v_{\lambda - 2}}{\bullet} & \underset{\hat v_{\lambda - 1}}{\bullet} & \underset{\hat v_\lambda}{\bullet} \\};
    \path[->,font=\scriptsize]
    (m-4-1) edge [bend left=20] node[auto] {$1$} (m-4-2)
    (m-4-2) edge [bend left=20] node[auto] {$\lambda$} (m-4-1)
            edge [bend left=20] node[auto] {$2$} (m-4-3)
    (m-4-3) edge [bend left=20] node[auto] {$\lambda - 1$} (m-4-2)
            edge [bend left=20] node[auto] {$3$} (m-4-4)
    (m-4-4) edge [bend left=20] node[auto] {$\lambda - 2$} (m-4-3)
            edge [bend left=20] node[auto] {$4$} (m-4-5)
    (m-4-5) edge [bend left=20] node[auto] {$\lambda - 3$} (m-4-4)
            edge [bend left=20] node[auto] {$\lambda - 3$} (m-4-6)
    (m-4-6) edge [bend left=20] node[auto] {$4$} (m-4-5)
            edge [bend left=20] node[auto] {$\lambda - 2$} (m-4-7)
    (m-4-7) edge [bend left=20] node[auto] {$3$} (m-4-6)
            edge [bend left=20] node[auto] {$\lambda - 1$} (m-4-8)
    (m-4-8) edge [bend left=20] node[auto] {$2$} (m-4-7)
            edge [bend left=20] node[auto] {$\lambda$} (m-4-9)
    (m-4-9) edge [bend left=20] node[auto] {$1$} (m-4-8);
    \draw[<-] (m-4-1) .. controls +(70:50pt) and +(110:50pt) .. node[pos=.5, above]{\scriptsize $\lambda$} (m-4-1);
    \draw[<-] (m-4-2) .. controls +(70:50pt) and +(110:50pt) .. node[pos=.5, above]{\scriptsize $\lambda - 2$} (m-4-2);
    \draw[<-] (m-4-3) .. controls +(70:50pt) and +(110:50pt) .. node[pos=.5, above]{\scriptsize $\lambda - 4$} (m-4-3);
    \draw[<-] (m-4-4) .. controls +(70:50pt) and +(110:50pt) .. node[pos=.5, above]{\scriptsize $\lambda - 6$} (m-4-4);
    \draw[<-] (m-4-6) .. controls +(70:50pt) and +(110:50pt) .. node[pos=.5, above]{\scriptsize $6 - \lambda$} (m-4-6);
    \draw[<-] (m-4-7) .. controls +(70:50pt) and +(110:50pt) .. node[pos=.5, above]{\scriptsize $4 - \lambda$} (m-4-7);
    \draw[<-] (m-4-8) .. controls +(70:50pt) and +(110:50pt) .. node[pos=.5, above]{\scriptsize $2 - \lambda$} (m-4-8);
    \draw[<-] (m-4-9) .. controls +(70:50pt) and +(110:50pt) .. node[pos=.5, above]{\scriptsize $-\lambda$} (m-4-9);
    \path[draw] (-4.1, -2) rectangle (3.7, 0);
    \draw (-3.5, -1) node {$e$:};
    \draw[<-] (-3.2, -1) .. controls +(-20:18pt) and +(200:18pt) .. (-1.7, -1);
    \draw (-.5, -1) node {$f$:};
    \draw[->] (-.2, -1) .. controls +(20:18pt) and +(160:18pt) .. (1.3, -1);
    \draw (2.5, -1) node {$h$:};
    \draw[<-] (3.1, -1.5) .. controls +(70:40pt) and +(110:40pt) ..  (2.9, -1.5);
    \draw (-.5, 5) node {$V(\lambda)$};
    \path[->,font=\scriptsize]
    (m-12-1) edge [bend left=20] node[auto] {$\lambda$} (m-12-2)
    (m-12-2) edge [bend left=20] node[auto] {$1$} (m-12-1)
            edge [bend left=20] node[auto] {$\lambda - 1$} (m-12-3)
    (m-12-3) edge [bend left=20] node[auto] {$2$} (m-12-2)
            edge [bend left=20] node[auto] {$\lambda - 2$} (m-12-4)
    (m-12-4) edge [bend left=20] node[auto] {$3$} (m-12-3)
            edge [bend left=20] node[auto] {$\lambda - 3$} (m-12-5)
    (m-12-5) edge [bend left=20] node[auto] {$4$} (m-12-4)
            edge [bend left=20] node[auto] {$4$} (m-12-6)
    (m-12-6) edge [bend left=20] node[auto] {$\lambda - 3$} (m-12-5)
            edge [bend left=20] node[auto] {$3$} (m-12-7)
    (m-12-7) edge [bend left=20] node[auto] {$\lambda - 2$} (m-12-6)
            edge [bend left=20] node[auto] {$2$} (m-12-8)
    (m-12-8) edge [bend left=20] node[auto] {$\lambda - 1$} (m-12-7)
            edge [bend left=20] node[auto] {$1$} (m-12-9)
    (m-12-9) edge [bend left=20] node[auto] {$\lambda$} (m-12-8);
    \draw[<-] (m-12-1) .. controls +(70:50pt) and +(110:50pt) .. node[pos=.5, above]{\scriptsize $\lambda$} (m-12-1);
    \draw[<-] (m-12-2) .. controls +(70:50pt) and +(110:50pt) .. node[pos=.5, above]{\scriptsize $\lambda - 2$} (m-12-2);
    \draw[<-] (m-12-3) .. controls +(70:50pt) and +(110:50pt) .. node[pos=.5, above]{\scriptsize $\lambda - 4$} (m-12-3);
    \draw[<-] (m-12-4) .. controls +(70:50pt) and +(110:50pt) .. node[pos=.5, above]{\scriptsize $\lambda - 6$} (m-12-4);
    \draw[<-] (m-12-6) .. controls +(70:50pt) and +(110:50pt) .. node[pos=.5, above]{\scriptsize $6 - \lambda$} (m-12-6);
    \draw[<-] (m-12-7) .. controls +(70:50pt) and +(110:50pt) .. node[pos=.5, above]{\scriptsize $4 - \lambda$} (m-12-7);
    \draw[<-] (m-12-8) .. controls +(70:50pt) and +(110:50pt) .. node[pos=.5, above]{\scriptsize $2 - \lambda$} (m-12-8);
    \draw[<-] (m-12-9) .. controls +(70:50pt) and +(110:50pt) .. node[pos=.5, above]{\scriptsize $-\lambda$} (m-12-9);
    \draw (-.5, -4) node {$V(\lambda)^\ast$};
\end{tikzpicture}
\caption{Graphs of $V(\lambda)$ and $V(\lambda)^\ast$} \label{figV}
\end{sidewaysfigure}

\end{document}

我想缩小它。当我改变

\begin{tikzpicture} [description/.style={fill=white,inner sep=2pt}]

\begin{tikzpicture} [description/.style={fill=white,inner sep=2pt}, transform canvas={scale=.7}]

标题移到了图的一侧,我不知道为什么会这样,也不知道该如何阻止它发生。有什么建议吗?

答案1

手册中指出:“图片尺寸的跟踪已(本地)关闭...”

这意味着边界框丢失,需要通过\useasboundingbox路径(= \path[use as bounding box])手动指定,并且该路径也需要在应用的范围之外transform canvas

您可能会考虑转换整个图片的必要性(这也会影响字体大小!)。

笔记

  • \hspace用这个\centering宏替换了你的宏。
  • \vpsace*与其他类类似,不需要。article我不知道amsart这里是做什么的。
  • backgrounds库及其键show background gridshow background rectangle被临时使用,因为它们以视觉方式显示边界框。

代码

\documentclass[12pt]{amsart}
\usepackage{rotating, tikz}
\usetikzlibrary{matrix,arrows,backgrounds}

\title{None}%

\begin{document}

\begin{sidewaysfigure}
\centering
\vspace*{350pt}
\begin{tikzpicture}[description/.style={fill=white,inner sep=2pt},show background grid,show background rectangle]
    \useasboundingbox (-6.5,-5) rectangle (6.5,4);
    \scope[transform canvas={scale=.7}]
         % Your actual drawing
    \endscope
\end{tikzpicture}
\caption{Graphs of $V(\lambda)$ and $V(\lambda)^\ast$} \label{figV}
\end{sidewaysfigure}
\end{document}

输出

在此处输入图片描述

相关内容