4

I have never drawn anything of LateX before, and I would like to represent intervals of the form [x,x'], with both x,x' real numbers, as I show below. I have 0 experience with tikz and altough I've read some files and tried to understanding it, I am finding it difficult to start to draw by myself. Thanks for all the help in advance. enter image description here

3
  • 1
    Welcome to TeX.SE!
    – Mensch
    Commented Dec 8, 2021 at 18:26
  • 1
    @Seabourn What you exactly want to do? To draw this figure or else one?
    – mmr
    Commented Dec 8, 2021 at 19:06
  • Sorry @mmr . I have edited the post with the image I would like to draw.
    – Rodrigo
    Commented Dec 8, 2021 at 19:11

1 Answer 1

5

Something like this could get you started:

\documentclass[border=1mm, tikz]{standalone}

\begin{document}
\begin{tikzpicture}[
    open interval/.style={circle, draw, fill=white, inner sep=1pt},
    closed interval/.style={circle, draw, fill, inner sep=1pt},
]

% intersection area
\fill[black!20] (-3,0) rectangle (3,1.1);

% real line
\draw[<->, thick] (-5,0) node[below] {$-\infty$} -- (5,0) node[below] {$+\infty$};

% [x, \infty[
\draw[->] (-3,0) node[below] {$x$} -- (-3,.9) node[closed interval] {} -- (5,.9);

% ]x', -\infty[
\draw[->] (3,0) node[below] {$x'$} -- (3,1.1) node[open interval] {} -- (-5,1.1);

\end{tikzpicture}
\end{document}

enter image description here

1
  • Thanks! Worked, this is exactly what I was looking for!
    – Rodrigo
    Commented Dec 8, 2021 at 19:38

You must log in to answer this question.

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