2

I'm trying to draw an axis with specific points on it, and curly braces above and below to emphasize certain intervals. The goal would be a picture somewhat what I sketched below :

goalsketch

I have something that's close but really bad. First the curly braces are not facing the right way. And also it's all quite clamped up, small and just looks bad overall. Here is my current result and below is the code for it :

mwe

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calligraphy}
\begin{document}
\begin{center}
\begin{tikzpicture}[decoration={calligraphic brace, amplitude=6pt}]
 \draw (-1,0) -- (4,0);
 \foreach \Point/\PointLabel in {(0,0)/a_0, (3.1415,0)/b_0, (1.5707,0)/b_1, (0.7853,0)/a_2}
        \draw[fill=black] \Point circle (0.05) node[above] {$\PointLabel$};
 \foreach \Point/\PointLabel in {(0,0)/a_1, (1.5707,0)/b_2, (0.7853,0)/a_2}
        \draw[fill=black] \Point circle (0.05) node[below] {$\PointLabel$};
 \draw[decorate,thick] (0,-0.8) -- node[below=1ex](I0){$I_0$} (3.1415,-0.8);
 \draw[decorate,thick] (0,-0.4) -- node[below=1ex]{$I_1$} (1.5707,-0.4);
 \draw[decorate,thick] (0.7853,0.4) -- node[above=1ex]{$I_2$} (1.5707,0.4);
\end{tikzpicture}
\end{center}
\end{document}

One way I thought I could be able to make everything further apart to make it look better is to change the coordinates, instead of going from -1 to 4, go from like -5 to 5 or something, but ideally I'm trying to not do that if possible because the a_i and b_i are terms of a sequence so they have a fixed value, even though the value doesn't appear on the graph.

3 Answers 3

2
  1. As already has been mentioned, you can use the mirror key to mirror the brace. Alternatively, you may just swap the start and end coordinates.
  2. In order to "unjam" the diagram, you can increase the x unit. This can be done by either adding xscale=factor or x=<length. Below I use x=2cm.
  3. pi is known to TikZ.
  4. You can make the loop more ergonomic and, in particular, give the nodes names that can be used for the braces.
  5. To find suitable vertical coordinates for the braces, you can use the current bounding box node, which gets continuously updated.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calligraphy}
\begin{document}
\begin{center}
\begin{tikzpicture}[x=2cm]
 \draw (-1,0) -- (4,0);
 \path foreach \X/\Y/\Z  in 
  {0/a_0/a_1, pi/b_0/, {pi/2}/b_1/b_2,{pi/4}/a_2/a_2}
     { (\X,0) node[circle,fill,inner sep=0.5mm,
        label=above:{$\Y$},label=below:{$\Z$},alias=\Z] (\Y) {}};
 \begin{scope}[thick,decoration={calligraphic brace, amplitude=6pt}]
  \draw[decorate]   (current bounding box.north) coordinate (aux)
    (a_2|-aux) -- node[above=1ex]{$I_2$} (b_1|-aux);
  \draw[decorate]   (current bounding box.south) coordinate (aux)
    (b_1|-aux) -- node[below=1ex]{$I_1$} (a_0|-aux);
  \draw[decorate]   (current bounding box.south) coordinate (aux)
    (b_0|-aux) -- node[below=1ex]{$I_0$} (a_0|-aux);
 \end{scope} 
\end{tikzpicture}
\end{center}
\end{document}

enter image description here

2

The braces require the mirror option to reverse them -- you can see the effect on the lower braces once you use it

Since you have applied a common option for all three braces its difficult to segregate the reversal -- so I feel better to have a separate command for all three braces as in the example below

enter image description here

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calligraphy}
\begin{document}
\begin{center}
\begin{tikzpicture}[decoration={calligraphic brace, mirror, amplitude=6pt}]
 \draw (-1,0) -- (4,0);
 \foreach \Point/\PointLabel in {(0,0)/a_0, (3.1415,0)/b_0, (1.5707,0)/b_1, (0.7853,0)/a_2}
        \draw[fill=black] \Point circle (0.05) node[above] {$\PointLabel$};
 \foreach \Point/\PointLabel in {(0,0)/a_1, (1.5707,0)/b_2, (0.7853,0)/a_2}
        \draw[fill=black] \Point circle (0.05) node[below] {$\PointLabel$};
 \draw[decorate,thick] (0,-0.8) -- node[below=1ex](I0){$I_0$} (3.1415,-0.8);
 \draw[decorate,thick] (0,-0.4) -- node[below=1ex]{$I_1$} (1.5707,-0.4);
 \draw[decorate,thick] (0.7853,0.4) -- node[above=1ex]{$I_2$} (1.5707,0.4);
\end{tikzpicture}
\par \vspace*{3cm}
\tikz[baseline, remember picture] \node[inner sep = 0pt, anchor = base] (mainclause) {She said}; 
\tikz[baseline, remember picture] \node[inner sep = 0pt, anchor = base] (subclause) {that he knows}; 
\begin{tikzpicture}[remember picture, overlay]
\draw[decorate, decoration ={brace,raise=1pt}] (subclause.north west) -- (subclause.north east)
node (subclauselabel) [midway, above=1pt] {\footnotesize{Subordinate clause}};
\draw[decorate, decoration = brace] (mainclause.north west |- subclauselabel.north west) -- (subclauselabel.north east)
node [midway, above] {\footnotesize{Main clause}};
\end{tikzpicture}
\end{center}
\end{document}
2

Try the following code, and edit it to suit your needs.

Note that to invert the brace use the , mirror option.

Also to make it vertical, use -- +(90:1.6) or -- +(-90:1.6) accordingly

\draw [violet, decorate,decoration={brace,amplitude=.2cm, mirror}, xshift=0cm, yshift=0cm] (0,-0.4) -- +(0:1.6) node [violet, midway, xshift=0cm, yshift=-.45cm] {\footnotesize $I_1$};

\draw [violet, decorate,decoration={brace,amplitude=.2cm, mirror}, xshift=0cm, yshift=0cm] (0,-0.94) -- +(0:3.16) node [violet, midway, xshift=0cm, yshift=-.5cm] {\footnotesize $I_0$};

which gives the following figure

enter image description here

You must log in to answer this question.

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