与图片的其余部分相比,节点字体大小很大

时间:2018-06-04 09:49:29

标签: fonts tikz

如何调整节点的字体大小(h),以便有一个合理的"尺寸与图片的其他部分相比?我不得不使用非常小数字的\ fontsize,但仍然不够!

enter image description here

\begin{figure}[!htbp]
    \begin{center}

    \begin{tikzpicture}[>=latex,scale=4, every node/.style={transform shape}]

    \foreach \x/\y in {-0.8368/0.3636,-0.9218/0.267,-0.9721/0.1317,-0.9218/-0.1775,-0.8098/-0.3128}
    { \draw[thick] (\x,\y) -- (-0.5968,0);}

    \foreach \x/\y in {0.7247/-0.3244,0.8368/-0.2316,0.9103/-0.05771,0.9141/0.1394,0.8136/0.3559}
    { \draw[thick] (\x,\y) -- (0.5968,0);}

    \draw[thick] (-0.5968,0.) -- (0.5968,0.) node(h)[pos = 0.25,above]{\fontsize{0.001cm}{0.01cm}\selectfont $S_I^2$} node(i)[pos = 0.75]{};

    \filldraw[gray] (-0.5968,0.) circle (0.2);
    \filldraw[gray] (0.5968,0.) circle (0.2);

    \filldraw[white] (0,0.) circle (0.2);
    \draw[thick] (0,0.) circle (0.2);

    \end{tikzpicture}


    \end{center}
\end{figure}

1 个答案:

答案 0 :(得分:1)

You can use a node-specific scale attribute (see scale=0.35):

\begin{figure}[!htbp]
  \begin{center}
    \begin{tikzpicture}[>=latex,scale=4, every node/.style={transform shape}]
      \foreach \x/\y in {-0.8368/0.3636,-0.9218/0.267,-0.9721/0.1317,-0.9218/-0.1775,-0.8098/-0.3128}
      { \draw[thick] (\x,\y) -- (-0.5968,0);}
      \foreach \x/\y in {0.7247/-0.3244,0.8368/-0.2316,0.9103/-0.05771,0.9141/0.1394,0.8136/0.3559}
      { \draw[thick] (\x,\y) -- (0.5968,0);}
      \draw[thick] (-0.5968,0.) -- (0.5968,0.) node(h)[pos = 0.25,above,scale=0.35]{\fontsize{0.001cm}{0.01cm}\selectfont $S_I^2$} node(i)[pos = 0.75]{};
      \filldraw[gray] (-0.5968,0.) circle (0.2);
      \filldraw[gray] (0.5968,0.) circle (0.2);
      \filldraw[white] (0,0.) circle (0.2);
      \draw[thick] (0,0.) circle (0.2);
    \end{tikzpicture}
  \end{center}
\end{figure}

enter image description here