在 tikzpicture 中用圆圈和线条保持平衡

在 tikzpicture 中用圆圈和线条保持平衡

我正在尝试重新创建以下内容在此处输入图片描述

然而,我遇到了圆圈的位置和大小问题。

我的代码:

 \tikzset{
    my circle/.pic={
      \node [draw, very thick, circle, minimum width=30pt, color=Green] {\tikzpictext};
    },
 my circle2/.pic={
      \node [draw, very thick, circle, minimum width=10pt, color=Orange] {\tikzpictext};
    },
  }

\begin{center}
\begin{tikzpicture}
\draw[very thick, -] (-1,0)--(3,1.5);
\draw[very thick, -] (1,0.76)--(1,-1);
\pic [pic text=Ανάγκες] at(-.5,.8) {my circle};
\pic [pic text=Αγαθά] at(3,2) {my circle2};
\end{tikzpicture}
\end{center}

您知道其他表现平衡与不平衡的方法吗?

答案1

through这里有一个使用库的选项tikz。您必须自己选择坐标。

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{through}
\begin{document}
  \begin{tikzpicture}
    \coordinate (a) at (-2,0);
    \coordinate (b) at (2,0);
    \draw[thick] (a) -- (b);
    \node [draw,circle through=(a),label=left:$H$] at (-2,1) {Heavy};
    \node [draw,circle through=(b),label=right:$L$] at (2,0.5) {Heavy};
    \draw[very thick] (0,0) -- (0,-1);
  \end{tikzpicture}

  \bigskip
  \begin{tikzpicture}
    \begin{scope}[rotate=20]   %% choose angle for rotation
    \coordinate (a) at (-2,0);
    \coordinate (b) at (2,0);
    \draw[thick] (a) -- (b);
    \node [draw,circle through=(a),label=left:$H$] at (-2,1) {Heavy};
    \node [draw,circle through=(b),label=right:$L$] at (2,0.5) {light};
    \draw[very thick] (0,0) -- +(250:1);  %% 270 - angle of rotation
    \end{scope}
  \end{tikzpicture}
\end{document}

在此处输入图片描述

您可以通过调整坐标(0.5 英寸)来选择圆的大小(2,0.5)。精细调整留作练习。

相关内容