1

I would like to create a graph like figure (shown in the image) with text and citations related to text. I manually created the image shown, but I would like to use Tikz (or anything else) to create it in Latex as I want to insert citations as means to visually display related work pertaining to my research. I picked the numbers for the citations randomly. In fact, I would like to replicate that image exactly as is with the shapes and colors (with modifications to text and citations). Is this possible? I would love some help in being able to this.

Thank you. Related Work

  • 2
    This is possible. Note however that it is best to show some own effort. What have you tried so far? Can you show us some code? Question addressing a specific issue are of more value to future visitors than complete do-it-for-me. – Skillmon likes topanswers.xyz Oct 5 '18 at 15:02
  • Thank you. I started out using these examples drawing-with-citations and hierarchical diagram. However, I found out that both are "trees" and getting them to have 2 parents was a bit difficult. Here is how far I've gotten. – shaun Oct 5 '18 at 15:20
  • It is good to see that you tried to accomplish this on your own. You should however add this code to your question and make the question self-contained. (I added the code now) – Skillmon likes topanswers.xyz Oct 5 '18 at 17:08
5

Check out the Forest package. Here's a simple example I created for you: enter image description here

\documentclass{article}
\usepackage{forest}
\begin{document}

\begin{forest}
   for tree={ellipse, edge+=->, l=3cm, inner sep=0.5cm}
   [Main, draw=blue!100, fill=blue!10
     [Type-1 \cite{itemone}, draw=green!50, fill=green!20
       [Technique-1 \cite{itemtwo}, draw=green!50, fill=green!20]
       [Type-3 \cite{itemthree}, name=type3, draw=yellow!50, fill=yellow!20
        [My Technique, top color=red!20, bottom color=red!100, rectangle]
       ]
     ]
     [Type-2, name=type2, draw=purple!50, fill=purple!20
       [Technique-1, draw=purple!50, fill=purple!20]
     ]
   ] 
   \draw[-latex] (type2) to (type3);
\end{forest}

\begin{thebibliography}{10}
\bibitem{itemone} 
Item One

\bibitem{itemtwo} 
Item Two

\bibitem{itemthree} 
Item Three
\end{thebibliography}

\end{document}
|improve this answer|||||
  • I copied this code after this was posted. Sorry I didn't update the post. It has gotten me started. Now it need to figure out the spacing and the shapes for different notes. I'll report my progress here. – shaun Oct 5 '18 at 17:22
  • @Skillmon The OP's original code is commented out in the Overleaf document. The code that is not commented out was what I provided in my post. – Roger Iyengar Oct 5 '18 at 17:51
  • @RogerIyengar sorry for misunderstanding then. – Skillmon likes topanswers.xyz Oct 5 '18 at 17:52
  • @shaun I edited the answer to add spacing and a different shape. You can see some additional examples of shapes here. – Roger Iyengar Oct 5 '18 at 17:53
  • @RogerIyengar again this was my fault, as I've mistakenly added your code claiming it was his. Really sorry for the mess I've created. I've removed the code. – Skillmon likes topanswers.xyz Oct 5 '18 at 18:04
3

I'd draw this "manually" just with the positioning library for positioning and some other libraries to add some other functionality. This only produces the TikZ figure, it doesn't incorporate any library.

\documentclass[tikz,border=2mm]{standalone}

\usetikzlibrary{shapes.geometric, positioning, shadings, arrows.meta}

\tikzset
  {
    ,my bubble/.style = 
      {
        ,draw=#1!70
        ,fill=#1!10
        ,ellipse
        ,inner sep=2pt
        ,minimum width=4em
        ,minimum height=2em
        ,align=center
      }
    ,my end/.style =
      {
        ,draw=#1!70
        ,top color=#1!10
        ,bottom color=#1!50
        ,minimum height=6em
        ,text width=6em
        ,inner sep=0pt
        ,align=center
      }
    ,my arrow/.style =
      {
        ,>=Stealth
        ,->
        ,draw=black
      }
  }

\begin{document}
\begin{tikzpicture}[node distance=6em and 2em]
  \node[my bubble=blue] (Main) {Main};
  \node[my bubble=green,below left=of Main]   (T1) {Type-1\\\relax[4-6]};
  \node[my bubble=purple,below right=of Main] (T2) {Type-2\\\relax[8-10]};
  \path (Main) ++(0,-16em) node[my bubble=orange] (T3) {Type-3\\\relax[15-21]};
  %
  \node[my bubble=green, left=of T3]   (T1-3) {Technique-3\\\relax[5-6]};
  \node[my bubble=green, left=of T1-3] (T1-2) {Technique-2\\\relax[7-12]};
  \node[my bubble=green, left=of T1-2] (T1-1) {Technique-1\\\relax[2-6]};
  %
  \node[my bubble=purple, right=of T3]   (T2-1) {Technique-1\\\relax[15-17]};
  \node[my bubble=purple, right=of T2-1] (T2-2) {Technique-2\\\relax[12-14]};
  \node[my bubble=purple, right=of T2-2] (T2-3) {Technique-3\\\relax[19-21]};
  %
  \node[my bubble=orange, below left=of T3]  (T3-1){Technique-1\\\relax[15-20]};
  \node[my bubble=orange, below right=of T3] (T3-2){Technique-2\\\relax[22-25]};
  %
  \path (T3) ++(0,-16em) node[my end=red] (end) {My\\Technique};
  %
  %
  \draw[my arrow] (Main) -- (T1);
  \draw[my arrow] (Main) -- (T2);
  %
  \draw[my arrow] (T1) -- (T3);
  \draw[my arrow] (T2) -- (T3);
  %
  \draw[my arrow] (T1) -- (T1-1);
  \draw[my arrow] (T1) -- (T1-2);
  \draw[my arrow] (T1) -- (T1-3);
  %
  \draw[my arrow] (T2) -- (T2-1);
  \draw[my arrow] (T2) -- (T2-2);
  \draw[my arrow] (T2) -- (T2-3);
  %
  \draw[my arrow] (T3) -- (T3-1);
  \draw[my arrow] (T3) -- (T3-2);
  \draw[my arrow] (T3) -- (end);
\end{tikzpicture}
\end{document}

enter image description here

|improve this answer|||||
  • I like this. However, it seems to require a separate document class. When I change the document class to letterpaper, it does not render. Unfortunately, I need it work within other document classes as this figure would appear within other stuff. – shaun Oct 5 '18 at 19:16
  • @shaun it does work with citations and it does work with article and the letterpaper option. It might need some reformatting or being displayed in landscape to fit the page, but it does work without throwing errors and does appear. – Skillmon likes topanswers.xyz Oct 5 '18 at 19:24

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.