2

I am trying to plot two circles one below the other. I also want two draw two arrows (I prefer solid curly arrows) between the circles.

So far I tried the below code, but it is not working. Can anyone help ?

\documentclass[12pt]{beamer}

\usepackage{tikz}
\usepackage{pifont}

\usetikzlibrary{shapes.geometric,arrows}
\tikzstyle{circ} = [circle, minimum size=1cm, text centered, draw = black, fill = red!30]
\tikzstyle{arrow} = [thick,->,>=stealth]

\begin{document}
\begin{frame}{Introduction}
\begin{block}{Model}
\begin{figure}
    \centering
    \begin{tikzpicture}[node distance=1cm]
    \node (env) [circ] {Environment};
    \node (agent) [circ, below of=env] {Agent};
    \draw [arrow] (env) -- (agent);
    \draw [arrow] (agent) -- (env);
    \end{tikzpicture}
\end{figure}
\end{block}
\end{frame}
\end{document}
  • Increasing the node distance, for example to 4cm, isn't enough? – ferahfeza Jul 31 '19 at 8:09
  • That is, you want a depth effect as if one circle were behind the other? – AndréC Jul 31 '19 at 8:14
  • I want two arrows between the circles (one from env to agent and other from agent to env). Also, if possible I want the arrows to be solid and curvy. – Shew Jul 31 '19 at 8:17
1

I guess that you looking for this:

enter image description here

  • For above image I employ TikZ library positioning and use its syntax below=of env (observe difference in order of = and of). With this the node distance define distance between nodes borders.

  • As you define distance between nodes (without using positioning library), node distance define distance between center of circles. So in your case it should be increased significantly (considering size of nodes' shapes)

  • Regarding arrows, for it is used bend left option for edges. If you like to have bend more curved than the picture above shows, than just add angle to bend, for example bend left=45:

  • Further costumization of styles I left to you. You can ease to change thickens of arrows and shape borders, their colors, size of text etc.

  • Note, use of \tikzstyle{...} = [...] s deprecated. Instead of it is recommended to use \tikzset{ ... } or define styles as options of tikzpicture as is done in MWE below.

\documentclass[12pt]{beamer}

\usepackage{tikz}
\usetikzlibrary{arrows.meta, 
                positioning}
\usepackage{pifont}

\begin{document}
\begin{frame}{Introduction}
\begin{block}{Model}
\begin{figure}
    \centering
    \begin{tikzpicture}[
    node distance = 1cm,
      circ/.style = {circle, draw, fill = red!30,
                     minimum size=1cm, align=center},
every edge/.style = {draw, very thick, -Stealth, bend left}
                        ]
    \node (env)   [circ] {Environment};
    \node (agent) [circ, below=of env] {Agent};
    \draw   (env)   edge[bend left] (agent)
            (agent) edge[bend left] (env);
    \end{tikzpicture}
\end{figure}
\end{block}
\end{frame}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.