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.
-
1Welcome to TeX.SE!– MenschCommented Dec 8, 2021 at 18:26
-
1@Seabourn What you exactly want to do? To draw this figure or else one?– mmrCommented Dec 8, 2021 at 19:06
-
Sorry @mmr . I have edited the post with the image I would like to draw.– RodrigoCommented Dec 8, 2021 at 19:11
Add a comment
|
1 Answer
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}