3

I've just created a TikZ image and somehow the delimiter in the right bottom corner is a little bit too wide. The delimiter should be 3 cm wide. Placing its middle at x=6.5 it should end at x=5 and x=8. But that's not the case and I don't find the error.

MWE:

\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{matrix}

\begin{document}
\begin{tikzpicture}[yscale=0.75]
\draw[help lines] (-2,-2) grid (8,6);

\tikzstyle{every node}=[font=\small, sharp corners, thick]
\tikzset{inner sep=2pt}

\newcommand{\akut}[1]{(0,0) -- node [draw, fill=white] {#1} (1,1)}
\newcommand{\chronisch}[1]{(0,0) -- node [draw, fill=white] {#1} (2,1)}
\newcommand{\schleichend}[1]{(0,0) -- node [draw, fill=white] {#1} +(1,1)}
\newcommand{\Schub}[1]{++(0.5,1.25) node [above, draw] {#1} -- ++(0.5,-0.5)}
\newcommand{\Welle}{+(0,0) to [out=0,in=180] +(0.5,1) node [above, draw] {1991} to [out=0,in=180] +(+0.5,-1)}
\newcommand{\Outcome}[1]{+(3,0) node [midway, above=2pt, draw] {#1}}

\draw [-][very thick, rounded corners]  \akut{1990} -- \Schub{1991} -- \Schub{1992} -- \Schub{1995} -- \Schub{1996} -- \Outcome{1999--2009} ;
\node [draw] (x) at (9,0) {Zeit};
\node [draw,align=center] (y) at (0,7) {Symptom-\\schwere};
\draw [<->] [thick] (y) -- (0,0) -- (x);
\node [above, below delimiter=\}] at (0.5,0) {\parbox{1cm}{\color{white}{.}}};
\node [draw] at (0.5,-0.55) {Beginn};
\node [above, below delimiter=\}] at (3,0) {\parbox{4cm}{\color{white}{.}}};
\node [draw] at (3,-0.55) {9-j\"ahriger Verlauf};
\node [above, below delimiter=\}] at (6.5,0) {\parbox{3cm}{\color{white}{.}}};
\node [draw] at (6.5,-0.55) {Outcome};
\node [left=2pt, draw]at (0,2) {leicht};
\node [left=2pt, draw]at (0,4) {mittel};
\node [left=2pt, draw]at (0,6) {schwer};
\end{tikzpicture}
\end{document}

Example: examplying the example

2
  • 1
    Add outer sep=0,inner sep=0 to the node to remove the spacing inside and outside the node.
    – percusse
    Commented Dec 28, 2013 at 11:45
  • It made the specified delimiter over Outcome better, but looking closely no delimiter is at the right place. I came up with another uproach.
    – ingo
    Commented Dec 28, 2013 at 13:05

1 Answer 1

2

I replaced my previous approach with the delimiters by drawing them with specified coordinates and then add a node. The new code looks like this:

\draw[decorate,decoration={brace,amplitude=3pt,mirror}] 
    (0,-1pt)  -- (1,-1pt) node [below=5pt, midway, draw] {Beginn}; 
\draw[decorate,decoration={brace,amplitude=3pt,mirror}] 
    (1,-1pt)  -- (5,-1pt) node [below=5pt, midway, draw] {9-j\"ahriger Verlauf}; 
\draw[decorate,decoration={brace,amplitude=3pt,mirror}] 
    (5,-1pt)  -- (8,-1pt) node [below=5pt, midway, draw] {Outcome}; 

MWE:

\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.pathreplacing}

\begin{document}
\begin{tikzpicture}[scale=1]
\draw[help lines] (-2,-2) grid (8,6);

\tikzstyle{every node}=[font=\small, sharp corners, thick]
\tikzset{inner sep=2pt}

\newcommand{\akut}[1]{(0,0) -- node [draw, fill=white] {#1} (1,1)}
\newcommand{\chronisch}[1]{(0,0) -- node [draw, fill=white] {#1} (2,1)}
\newcommand{\schleichend}[1]{(0,0) -- node [draw, fill=white] {#1} +(1,1)}
\newcommand{\Schub}[1]{++(0.5,1.25) node [above, draw] {#1} -- ++(0.5,-0.5)}
\newcommand{\Welle}[1]{++(0.5,1.25) node [above, draw] {#1} -- ++(0.5,-1.25)}
\newcommand{\Outcome}[1]{+(3,0) node [midway, above=2pt, draw] {#1}}

\draw [-][very thick, rounded corners]  \akut{1990} -- \Schub{1991} -- \Schub{1992} -- \Schub{1995} -- \Schub{1996} -- \Outcome{1999--2009} ;
\node [draw] (x) at (9,0) {Zeit};
\node [draw,align=center] (y) at (0,7) {Symptom-\\schwere};
\draw [<->] [thick] (y) -- (0,0) -- (x);

\draw[decorate,decoration={brace,amplitude=3pt,mirror}] 
    (0,-1pt)  -- (1,-1pt) node [below=5pt, midway, draw] {Beginn}; 
\draw[decorate,decoration={brace,amplitude=3pt,mirror}] 
    (1,-1pt)  -- (5,-1pt) node [below=5pt, midway, draw] {9-j\"ahriger Verlauf}; 
\draw[decorate,decoration={brace,amplitude=3pt,mirror}] 
    (5,-1pt)  -- (8,-1pt) node [below=5pt, midway, draw] {Outcome}; 

\node [above left=2pt, draw]at (0,0) {Heilung};
\node [left=2pt, draw]at (0,2) {leicht};
\node [left=2pt, draw]at (0,4) {mittel};
\node [left=2pt, draw]at (0,6) {schwer};

\end{tikzpicture}
\end{document}

Example done with TexStudio

You must log in to answer this question.

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