mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-26 06:48:04 +02:00
added 3 examples
This commit is contained in:
parent
33c9a52e82
commit
e3ac2dc858
6 changed files with 191 additions and 0 deletions
33
tikz/dirichlet-function/dirichlet-function.tex
Normal file
33
tikz/dirichlet-function/dirichlet-function.tex
Normal file
|
@ -0,0 +1,33 @@
|
|||
\documentclass{article}
|
||||
\usepackage[pdftex,active,tightpage]{preview}
|
||||
\setlength\PreviewBorder{2mm}
|
||||
|
||||
\usepackage{amssymb,amsmath}
|
||||
\usepackage{pgfplots}
|
||||
|
||||
\begin{document}
|
||||
\begin{preview}
|
||||
\begin{tikzpicture}
|
||||
\begin{axis}[
|
||||
axis lines=middle,
|
||||
width=15cm, height=15cm, % size of the image
|
||||
grid = both,
|
||||
grid style={dashed, gray!30},
|
||||
enlargelimits=true,
|
||||
xmin=-1, % start the diagram at this x-coordinate
|
||||
xmax= 1, % end the diagram at this x-coordinate
|
||||
ymin= 0, % start the diagram at this y-coordinate
|
||||
ymax= 1, % end the diagram at this y-coordinate
|
||||
/pgfplots/xtick={-1,-0.8,...,1}, % make steps of length 0.2
|
||||
/pgfplots/ytick={0,0.1,...,1}, % make steps of length 0.1
|
||||
axis background/.style={fill=white},
|
||||
ylabel=y,
|
||||
xlabel=x,
|
||||
legend style={at={(0.8,0.8)}, anchor=north}]
|
||||
\addplot[domain=-1:1, ultra thick,samples=100,red] {1};
|
||||
\addplot[domain=-1:1, ultra thick,samples=100,blue] {0};
|
||||
\legend{$1 \text{, if } x \in \mathbb{Q}$, $0 \text{, if } x \in \mathbb{R} \setminus \mathbb{Q}$}
|
||||
\end{axis}
|
||||
\end{tikzpicture}
|
||||
\end{preview}
|
||||
\end{document}
|
Loading…
Add table
Add a link
Reference in a new issue