3

In this picture, I am trying to create a map of topics covered in my dissertation. I simply copied and changed elements in something that was already on this website. I will appreciate any further modification to make the overall picture smaller by reducing the boxes. I want to eliminate A, B, C, and duck for the notes (they can rather be replaced by chapters 2, 3, 4, and 5 where the central one is already chapter 1.

enter image description here

\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning,shapes.misc}
\tikzset{
  figNode/.style={
    path picture={
      \node at (path picture bounding box.center) {#1};}}
}
\begin{document}

\begin{tikzpicture}[thick]
  \node (a) at (60:10){};
  \node (b) at (20:10){};
  \node (c) at (-20:10){};
  \node (d) at (-60:10){};
  %\node (e) at (-80: 10){};
  
  \foreach \r/\c in {90/blue,45/green,0/red,-45/yellow}{
    \fill[\c!50] (0,0) -- (\r:4) arc (\r:\r-45:4) -- cycle;
  };
  
  \foreach \r/\c/\p in {67.5/blue/a,22.5/green/b,-22.5/red/c,-67.5/yellow/d}{
    \draw[\c] (\r:4) -- (\p);
    \fill[gray!50] (\r:4) circle (0.5);
    \fill[\c] (\r:4) circle (0.25);
  };
  
  \draw[fill=white] (0,0) circle (3) node[align=center]{Chapter 1: Campactness};
  
  \draw[rounded corners=25pt, fill=gray!50] (3.5,7) rectangle ++(7,3.5);
  \draw[fill=blue!50, figNode={\includegraphics[width=0.2\textwidth]{example-image-a}}]
    (a) circle (1);
  \node[right=2 of a, rounded rectangle=25pt, rounded rectangle west arc=none, draw, fill=blue!50,
    minimum height=2cm, minimum width=3cm] {Chapter 2: Degrees of compactness (Schauder's theorem and s-numbers)};
  
  \draw[rounded corners=25pt, fill=gray!50] (7.8,1.6) rectangle ++(7,3.5);
  \draw[fill=green!50, figNode={\includegraphics[width=0.2\textwidth]{example-image-b}}]
    (b) circle (1);
  \node[right=2 of b, rounded rectangle=25pt, rounded rectangle west arc=none, draw, fill=green!50,
    minimum height=2cm, minimum width=3cm] {Chapter 3: Approximation Schemes ( Q-Compactness, Degrees of Q-compactness) };
  
  \draw[rounded corners=25pt, fill=gray!50] (8,-5) rectangle ++(7,3.5);
  \draw[fill=red!50, figNode={\includegraphics[width=0.2\textwidth]{example-image-c}}]
    (c) circle (1);
  \node[right=2 of c, rounded rectangle=25pt, rounded rectangle west arc=none, draw, fill=red!50,
    minimum height=2cm, minimum width=3cm] {Chapter 4: Realizing certain approximation spaces as interpolation spaces (Applications of interpolation theory to PDEs)};
  
  \draw[rounded corners=25pt, fill=gray!50] (3.2,-10.4) rectangle ++(7,3.5);
  \draw[fill=yellow!50, figNode={\includegraphics[width=0.2\textwidth]{example-image-duck}}]
    (d) circle (1);
  \node[right=2 of d, rounded rectangle=25pt, rounded rectangle west arc=none, draw, fill=yellow!50,
    minimum height=2cm, minimum width=3cm] {Chapter 5: H-Operators as applications of interpolation theory};
\end{tikzpicture}
\end{document}

3
  • I do not know how to display the output from the above code. But if such a picture were to be displayed, then my original post clearly stated what I wanted to be changed. Mar 10, 2023 at 19:31
  • @DanielAkechThiong It is how to do the changes, and by how much, that have multiple ways of being interpreted. A,B,C and duck are image files. Since "Chapter 2" is already in the long tag, putting a "2" (image or text?) in place of "A" is redundant, isn't it? And the gray background is part of the "A" image. Removing the "A" image gives a nice effect: the background colour (blue) now comes through. What does reducing all the dimensions look like (e.g., if "smaller" means 50%, say)?
    – Cicada
    Mar 11, 2023 at 8:34
  • @DanielAkechThiong (Note to self: never underestimate image design effort.) Changing the shape sizes means the long text doesn't fit anymore. A redesign is likely needed. Where did you get the code from? That might provide some context on any constraints. How big should the picture be? 2cm? 5cm? Half a page? Instead of long text shrunk to small point sizes, would a concise phrase be more practical for readability? Actual images could work, too.
    – Cicada
    Mar 11, 2023 at 8:54

1 Answer 1

2

Here's a way to do it to provide a better starting point for you.

Main steps:

  • applying refactoring to your code, see e.g. here for more info
  • \tikzset for figNode became obsolete (images are gone)
  • macros (\newcommands) \graybox and \colorcirc simplify your code
  • similar for (new) styles cmnnode and cmnbox
  • made your "chapter-nodes" capable of multiline with larger fonts
  • refactoring could still go a level further, e.g. to absorb the multiple font statements (but that's always up to the programmer)

Note: The macros already provide the semicolon ; tikz badly need. But you could change that, if you like, e.g. into \graybox{(3.5,7)}; (just put it there).

Remember: node text inside { } accepts any LaTeX "text", like making some words bold, putting a table or an image etc. inside.


What you gain from this approach:

  • cleaner code (beauty-code), more "verbal" about what it will show
  • "change in one place only" approach (styles, \newcommand)
  • easier to further adjust to your needs

Suggestion: If you haven't done yet, spend some time on the tutorials in the beginning of the PGF manual , and look up the tikz-commands used here e.g. via seach/find or index inside that pdf.

result

\documentclass[12pt,border=3mm]{standalone}% <<<---
\usepackage{tikz}
\usetikzlibrary{positioning,shapes.misc}

%\tikzset{% <<<--- became irrelevant from REFACTORING
%  figNode/.style={
%    path picture={
%      \node at (path picture bounding box.center) {#1};}}
%}

% ~~~ macros (shorthand notations) from REFACTORING ~~~~~~~~~~~~~~~~~~~~~~~
\newcommand\graybox[1]{\draw[cmnbox] #1 rectangle ++(7,3.5);}% the gray boxes

\newcommand\colcirc[3]{% #1=color, #2=nodes name, #3=text
    \draw[#1]      (#2) circle (1);%
    \node [font=\Large]     at (#2) {#3};}% to put text, like 2, ch 2 etc.

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{document}

  \begin{tikzpicture}
    [thick,
    cmnnode/.style={rounded rectangle=25pt,% common node style
                    rounded rectangle west arc=none,
                    draw,
                    minimum height=2cm, minimum width=3cm,% these you had already
                    font=\Large,% larger fonts; \LARGE would be maximum
                    align=left,% for multilines, indicated by \\
                    inner sep=1em% give it a bit more space to breath
                    },
    cmnbox/.style= {rounded corners=25pt,% common box style
                    fill=gray!50}
    ]
    \node (a) at (60:10){};
    \node (b) at (20:10){};
    \node (c) at (-20:10){};
    \node (d) at (-60:10){};
    %\node (e) at (-80: 10){};
  
    % ~~~ colored arc segments ~~~~~~~~~~~~~~~~~~~~
    \foreach \r/\c in {90/blue,45/green,0/red,-45/yellow}{
      \fill[\c!50] (0,0) -- (\r:4) arc (\r:\r-45:4) -- cycle;
    };
  
    % ~~~ small gray and colored circles ~~~~~~~~~~~~~~
    \foreach \r/\c/\p in {67.5/blue/a,22.5/green/b,-22.5/red/c,-67.5/yellow/d}{
      \draw[\c]         (\r:4) -- (\p);
      \fill[gray!50]    (\r:4) circle (0.5);
      \fill[\c]         (\r:4) circle (0.25);
    };
  
    % ~~~ root-circle ~~~~~~~~~~~~~~~~
    \draw[fill=white,font=\Large] (0,0) circle (3) node[align=center]{\textbf{Chapter 1}:\\ Campactness};% augmented: font, \\ (multiline), \textbf{} for bold text-part 
  
    % ~~~ 1st, blue ~~~~~~~~~~~~~~~~
    \graybox{(3.5,7)}               % simplified, see macro above
    \colcirc{fill=blue!50}{a}{2}    % simplified, see macro above
    % reusing common node style, some bold text, \\ (multiline)
    \node[right=2 of a, cmnnode, fill=blue!50] {\textbf{Chapter 2}: Degrees of compactness\\(Schauder's theorem and s-numbers)};
  
    % ~~~ 2nd, green ~~~~~~~~~~~~~~~~~
    \graybox{(7.8,1.6)}
    \colcirc{fill=green!50}{b}{3}
    \node[right=2 of b, cmnnode, fill=green!50] {\textbf{Chapter 3}: Approximation Schemes\\( Q-Compactness, Degrees of Q-compactness) };
  
    % ~~~ 3rd, red ~~~~~~~~~~~~~~~~~
    \graybox{(8,-5)}
    \colcirc{fill=red!50}{c}{4}
    \node[right=2 of c, cmnnode, fill=red!50] {Chapter 4: Realizing certain approximation spaces as interpolation\\spaces (Applications of interpolation theory to PDEs)};
  
     % ~~~ 4th, yellow ~~~~~~~~~~~~~~~~~~~~~
    \graybox{(3.2,-10.4)}
    \colcirc{fill=yellow!50}{d}{5}
     \node[right=2 of d, cmnnode, fill=yellow!50] {Chapter 5: H-Operators as applications of interpolation theory};
    
    
  \end{tikzpicture}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .