圆圈大小 tikzpicture

圆圈大小 tikzpicture

我想将“加号”圆圈的尺寸设置得更小一些。我尝试过最小尺寸半径但什么都没改变。这里是最小文档:

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{arrows,positioning} 
\tikzset{
    %Define standard arrow tip
    >=stealth',
    %Define style for boxes
    punkt/.style={
           rectangle,
           rounded corners,
           draw=black, very thick,
           text width=6.5em,
           minimum height=2em,
           text centered},
    % Define arrow style
    pil/.style={
           ->,
           thick,
           shorten <=2pt,
           shorten >=2pt}
}

\begin{document}
\begin{frame}
\begin{tikzpicture}[node distance=1cm, auto,]
 nodes
 \node[punkt] (boosting) {Boosting};
 \node[right=of boosting] (dummy) {};
 \node[punkt, right=of dummy, minimum size=0.1cm] (fqi) {Fitted Q-Iteration};
 \node[punkt, circle,minimum size=0.1cm, below=of dummy] (plus) {$+$};
 \node[punkt, below=of plus] (bfqi) {Boosted Fitted Q-Iteration};

\end{tikzpicture}
\end{frame}
\end{document}

另外,我还想了解如何将“fqi”和“bfqi”框住与“boosting”节点相同的高度(不分成两行)。

答案1

除了 Torbjørn T. 的回答之外,inner sep=...您还可以选择从文本到节点边框的距离。

为了不破坏节点内的线条,请设置text width=...足够大以包含所有文本(但这样做会导致您的图像太靠近右边框)。

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{arrows,positioning} 
\tikzset{
    %Define standard arrow tip
    >=stealth',
    %Define style for boxes
    punkt/.style={
        rectangle,
        rounded corners,
        draw=black, very thick,
        text width=11.5em,
        minimum height=2em,
        text centered},
    % Define arrow style
    pil/.style={
        ->,
        thick,
        shorten <=2pt,
        shorten >=2pt}
}

\begin{document}
    \begin{frame}
    \begin{tikzpicture}[node distance=1cm, auto,]
    nodes
    \node[punkt] (boosting) {Boosting};
    \node[right=of boosting] (dummy) {};
    \node[punkt, right=of dummy] (fqi) {Fitted Q-Iteration};
    \node[draw, circle,  inner sep=2pt, below=of dummy] (plus) {$+$};
    \node[punkt, below=of plus] (bfqi) {Boosted Fitted Q-Iteration};

    \end{tikzpicture}
\end{frame}
\end{document}

答案2

您的punkt样式包括text width=6.5em,这就是圆圈如此之大的原因。在该节点的选项中添加 eg 以覆盖text width=1em样式。punktpunkt

在此处输入图片描述

\documentclass{beamer}    
\usepackage{tikz}
\usetikzlibrary{arrows,positioning} 
\tikzset{
    %Define standard arrow tip
    >=stealth',
    %Define style for boxes
    punkt/.style={
           rectangle,
           rounded corners,
           draw=black, very thick,
           text width=6.5em,
           minimum height=2em,
           text centered},
    % Define arrow style
    pil/.style={
           ->,
           thick,
           shorten <=2pt,
           shorten >=2pt}
}

\begin{document}
\begin{frame}
\begin{tikzpicture}[node distance=1cm, auto,]
 nodes
 \node[punkt] (boosting) {Boosting};
 \node[right=of boosting] (dummy) {};
 \node[punkt, right=of dummy, minimum size=0.1cm] (fqi) {Fitted Q-Iteration};
 \node[punkt, circle, text width=1em, below=of dummy] (plus) {$+$};
 \node[punkt, below=of plus] (bfqi) {Boosted Fitted Q-Iteration};

\end{tikzpicture}
\end{frame}
\end{document}

相关内容