Using TikZ and PGFPlots for Bubbles and Innovation

Using TikZ and PGFPlots for Bubbles and Innovation

July 29, 2021

TikZ and PGFPlots in “Bubbles and the Value of Innovation”

To use the code just insert it into any LaTeX code with the appropriate tikz libraries; see here for examples.

Household disagreement #

Households disagree on firms productivity and invest in them in consequence:

Detail Disagreement
\tikzset{
  pil/.style={ ->, thick, shorten <=0.5pt,  shorten >=0.5pt,},
  shaded/.style={circle,radius=\r,draw, pattern=north west lines,pattern color=black},
  households/.style={rectangle, draw, fill=black!10, inner sep=5pt, 
                     text width=4cm, text badly centered, minimum height=1.75cm, 
                     font=\Large\sffamily}
}
% =============================================
% Large circle split in 4
  \begin{scope}[color=black]
    \draw[clip] (0, 0) circle (5cm);
  \end{scope}
  \draw [dashed] (0, 0) -- (0, 5);
  \draw [dashed] (0, 0) -- (0, -5);
  \draw [dashed] (0, 0) -- (5, 0);
  \draw [dashed] (0, 0) -- (-5, 0);
% =============================================  
% Circles in each of the separation  1
  \node[circle, draw=black, fill=white, inner sep=0pt,minimum size=15pt] (dc11) at (1.2, -3.5) {};
  \node[circle, draw=black, fill=white, inner sep=0pt,minimum size=15pt] (dc12) at (2, -1.5) {};
  \node[circle, draw=black, fill=white, inner sep=0pt,minimum size=15pt] (dc13) at (4, -2) {};
  \node[circle, draw=black, fill=white, inner sep=0pt,minimum size=15pt] (dc13) at (1., -2) {};
% Circles in each of the separation  2  
  \node[circle, draw=black, fill=white, inner sep=0pt,minimum size=15pt] (dc31) at (-1.2, -3.5) {};
  \node[circle, draw=black, fill=white, inner sep=0pt,minimum size=15pt] (dc32) at (-2, -1.5) {};
  \node[circle, draw=black, fill=white, inner sep=0pt,minimum size=15pt] (dc33) at (-3.75, -2) {};
  \node[circle, draw=black, fill=white, inner sep=0pt,minimum size=15pt] (dc13) at (-3., -3) {};
% Circles in each of the separation  3
  \node[circle, draw=black, fill=white, inner sep=0pt,minimum size=15pt] (dc41) at (-1.2, 3.5) {};
  \node[circle, draw=black, fill=white, inner sep=0pt,minimum size=15pt] (dc42) at (-2, 1.5) {};
  \node[circle, draw=black, fill=white, inner sep=0pt,minimum size=15pt] (dc43) at (-3.75, 2) {};
  \node[circle, draw=black, fill=white, inner sep=0pt,minimum size=15pt] (dc13) at (-2.75, +2.75) {};
% Last circle for all the other groups  
  \node at (2, 2) {\Huge  \emph{etc.}};
% =============================================  
% Draw Households
  \node (investor1) at (-8,-1) {};
  \node (investor2) at (-8, 1) {};
  \node[alice, shirt = blue, saturated, minimum size=1.cm] at (-8., -1.) {}; 
  \node[alice, shirt = red, skin=brown, hair=gray, saturated, minimum size=1.cm] at (-8., 1.) {}; 
  \node[alice, shirt = gray, skin=brown, saturated, minimum size=1.cm] at (-10., -1.) {}; 
  \node[bob, saturated, minimum size=1.cm] at (-10., 1.) {}; 
  \node[businessman, female, shirt = gray, skin=brown,  minimum size=1.cm] at (-12., -1.) {}; 
  \node[charlie, shirt = gray,  minimum size=1.cm] at (-12., 1.) {}; 
% =============================================
% Households Preferences
  \node at (-0.7, -3.5) [red] {\Large \bfseries  3};
  \node at (-0.4,  -3.5) [blue] {\Large \bfseries 1};
  \node at (-1.55, -1.5) [red] {\Large \bfseries  2};
  \node at (-1.25,  -1.5) [blue] {\Large \bfseries 3};
  \node at (-3.3,  -2) [red] {\Large \bfseries 1};
  \node at (-3., -2) [blue] {\Large \bfseries 2};
  \node at (-2.5, -3)  [red] {\Large  \bfseries 4};
  \node at (-2.2, -3)  [blue] {\Large  \bfseries 4};
% =============================================
% All rankings
  \node at (-0.7, 3.5) [red] {\Large \bfseries  3};
  \node at (-0.4, 3.5) [blue] {\Large \bfseries 2};
  \node at (-1.55,1.5) [red] {\Large \bfseries  2};
  \node at (-1.25,1.5) [blue] {\Large \bfseries 1};
  \node at (-3.3, 2) [red] {\Large \bfseries 1};
  \node at (-3.,  2) [blue] {\Large \bfseries 4};
  \node at (-2.3,  2.75) [red] {\Large \bfseries 4};
  \node at (-2.0,  2.75) [blue] {\Large \bfseries 3};
  \node at (1.65, -3.5) [red] {\Large \bfseries  1};
  \node at (1.95, -3.5) [blue] {\Large \bfseries 1};
  \node at (2.45,-1.5) [red] {\Large \bfseries  2};
  \node at (2.75,-1.5) [blue] {\Large \bfseries 3};
  \node at (3.3,  -2) [red] {\Large \bfseries 3};  
  \node at (3.55, -2) [blue] {\Large \bfseries 4};
  \node at (1.8, -2)  [red] {\Large  \bfseries 4};
  \node at (1.5, -2)  [blue] {\Large  \bfseries 2};
% =============================================
% Link Investors with their investments
  \draw[pil, bend left=35, draw=red]    (-7.5, 1)  to   (dc33.north);
  \draw[pil, bend right=35, draw=blue]  (-7.5, -1) to   (dc31.west);
  \draw[pil, bend left=35, draw=red]    (-7.5, 1)  to   (dc43.west);
  \draw[pil, bend right=35, draw=blue]  (-7.5, -1) to   (dc42.south);
  \draw[pil, bend left=35, draw=red]    (-7.5, 1)  to   (dc11.north);
  \draw[pil, bend right=40, draw=blue]  (-7.5, -1) to   (dc11.south);
  \node[circle, fill=blue, minimum size=15pt] (dc31blue) at (-1.2, -3.5) {};
  \node[circle, fill=red, minimum size=15pt] (dc33red) at (-3.75, -2) {};
  \node[circle, fill=blue, minimum size=15pt] (dc31blue) at (-2, 1.5) {};
  \node[circle, fill=red, minimum size=15pt] (dc33red) at (-3.75, 2) {};
  \node[semicircle, fill=blue, minimum size=7.5pt, rotate=90] (dc42blue)  at (1.1, -3.5) {};
  \node[semicircle, fill=red,  minimum size=7.5pt, rotate=270] at (1.3,-3.5) {};   

Innovation Stage #

Creation of blueprints and trading

Blueprint Creation Stage
\begin{scope}[color=black]
  \node[households] (households) at (-7, -1) {Households $j$};
  \draw[myarrow]  (0.2, 4.0) -- (-3.4, 0.25);
  \node[households] (creators) at (13, -1) {Firm Creators};
  \node[align=left, font=\footnotesize] (bs1) at (13, -3) {collects $p_i - p_b$};
  \draw[myarrow] (-3.4, -2.25) -- (0.2, -6);
  \node[font = \footnotesize, anchor = south] (firmprod) at (-3.9, -5) {Produce};
  \node[font = \footnotesize, anchor = south] (firmprod) at (-3.9, -6.25) {effort cost $W(b)$};
  \draw[myarrow]  (5.8, -6) -- (9.4, -2.25);
  \node[font = \footnotesize, anchor = south] (firmbuy) at (8.5, -5.5) {Buy};
  \draw[myarrow]  (9.4 , 0.25) -- (5.8, 4.0);
  \node[font = \footnotesize, anchor = south] (firmbuy) at (8.5, 2) {Sell};
  \node[font = \footnotesize, anchor = south] (firmprod) at (-3.7, 2) {Buy shares};
  \draw[dasharrow] (-3.5, -1) -- (9.5, -1);
  \node[font = \footnotesize, anchor = south] (firmbuy) at (3, -1) {Own};
% BLUEPRINTS
  \draw (3,-7) circle (3cm);
  \node[font=\footnotesize, anchor=west] (blue) at (0.3,-6.)  {\textbf{Blueprints}};    
  \node (bp11) at (2,   -7.5) {\circle{4}};
  \node (bp12) at (1.7, -8) {\circle{4}};
  \node (bp13) at (2.4, -7.65) {\circle{4}};
  \node (bp14) at (3,   -9.2) {\circle{4}};
  \node (bp15) at (1.9, -8.5) {\circle{4}};
  \node (bp16) at (3,   -9.7) {\circle{4}};
  \node (bp17) at (3,   -8) {\circle{4}};
  \node (bp18) at (3.7, -7.2) {\circle{4}};
  \node (bp19) at (4.4, -8.65) {\circle{4}};
  \node (bp20) at (5,   -9) {\circle{4}};
  \node (bp21) at (3.9, -9.5) {\circle{4}};
  \node (bp22) at (5,   -7.7) {\circle{4}};
% FIRMS
  \draw (3, 5) circle (3cm);
  \node[font=\footnotesize] (consfirms) at ( 3, 6)  {\textbf{Firms} $i$};    
  \draw (4.5, 4) circle (0.5cm);
  \node at (4.5, 4) {?};
  \draw (3, 3.1) circle (0.5cm);
  \node at (3, 3.1) {?};
  \draw (1.8, 3.3) circle (0.5cm);
  \node at (1.8, 3.3) {?};
  \draw (2.6, 4.5) circle (0.5cm);
  \node at (2.6, 4.5) {?};
\end{scope}

Production Stage #

Firms compete and produce; consumers receive proceeds from their investments

Production Stage
\begin{scope}[color=black, xshift=0cm, yshift=0cm]
    \node[households] (households) at (-7, -1) {Households $j$};
    \draw[myarrow]  (0.2, 4.0) -- (-3.4, 0.25);
    \node[font = \footnotesize, anchor = south] (consbuy) at (-3.5, 2) {Consume};
    \draw[clip] (3, 5) circle (3cm);
    \fill[gray!30] (0.5, 5) circle (3cm); 
    \node (dc15) at (2,   3.6) {\circle*{8.2}};    
    \node (dc11) at (1.5, 4.1)  {\circle*{8.2}};
    \node (dc14) at (2.8, 4) {\circle*{9}};
    \node (dc12) at (2.8,   5.1) {\circle*{8}};
    \node (dc13) at (2.1, 5.8) {\circle*{10}};
    \node (dc16) at (2,   6.8) {\circle*{11}};
    \draw [pattern=north west lines,pattern color=black] (4, 3) circle (2.25 mm);
    \draw [pattern=north west lines,pattern color=black] (5.5, 4) circle (1.5 mm);
    \draw [pattern=north west lines,pattern color=black] (4.7, 3.85) circle (1.9 mm);    
    \draw [pattern=north west lines,pattern color=black] (3.3, 6.75) circle (1.7 mm);
    \draw [pattern=north west lines,pattern color=black] (4,   4) circle (1.2 mm);
    \draw [pattern=north west lines,pattern color=black] (4, 5.5) circle (2 mm);    
    \draw [pattern=north west lines,pattern color=black] (5, 6) circle (1 mm);
    \draw [pattern=north west lines,pattern color=black] (4.95, 6.7) circle (2.05 mm);
    \node[font=\footnotesize] (consfirms) at ( 3, 1.5)  {\textbf{Firms} $i$};      
\end{scope}     


TeX