TransWikia.com

Number axis with interval symbols

TeX - LaTeX Asked on May 4, 2021

I am looking for something like this:

axis

I have tried using the pgfplots package, but I cannot figure out how to add the brackets or the colors

One Answer

Based on one of the similar previous answer (which I temporary can't find):

documentclass[tikz, margin=3mm]{standalone}
usetikzlibrary{arrows.meta}

begin{document}
begin{tikzpicture}
  draw (-3,0) -- (3,0);
  draw (0,2pt) -- (0,-2pt) node[below=2mm] {$0$};
  draw[{Bracket[width=4mm]}-{Bracket[width=4mm]}] 
    (-2,0) node[below=2mm] {$-1$} -- ( 2,0) node[below=2mm] {$ 1$};
  draw[{Parenthesis[width=4mm]}-{Parenthesis[width=4mm]}]
    (-1,0) node[below=2mm] {$-frac{1}{2}$} -- (1,0) node[below=2mm] {$ frac{1}{2}$};
end{tikzpicture}
end{document}

enter image description here

Correct answer by Zarko on May 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP