21

How can I make the curly braces on TikZ to label the x and y as in this picture?enter image description here

1
  • 1
    It's a brace decoration. Commented Feb 28, 2015 at 2:41

1 Answer 1

41

You are looking for a brace decoration from the decorations.pathreplacing library:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,angles,quotes}

\begin{document}

\begin{tikzpicture}
\draw[->] (0,0) coordinate (O) -- (3,0);
\draw[->] (O) -- (0,4);
\node[inner sep=1.5pt,fill,circle,label={60:$(x,y)$}] at (2,3) (point) {};
\draw (0,0) -- (point);
\draw (1.8,0) -- ++(0,0.2) -- ++(0.2,0);
\draw[dashed] (2,0) coordinate (pointx) -- (point); 
\draw[decoration={brace,mirror,raise=5pt},decorate]
  (2,0) -- node[right=6pt] {$y$} (point);
\draw[decoration={brace,mirror,raise=5pt},decorate]
  (0,0) -- node[below=6pt] {$x$} (2,0);
\path pic ["$\theta$", draw, ->] {angle=pointx--O--point};  
\end{tikzpicture}

\end{document}

enter image description here

2
  • 4
    Also an option is adding \usetikzlibrary{bending} for improving arrow tips at the end of curved lines. Commented Feb 28, 2015 at 3:14
  • @Gonzalo what do the angles and quotes tikzlibraries contribute with? Just trying to learn :)
    – Matt
    Commented Feb 10, 2020 at 22:34

You must log in to answer this question.

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