با استفاده از بسته pgfplots
میتوان این نمودارها را رسم کرد. برای رسم آکولاد زیر نمودار سوم کتابخانههای patterns
و decorations.pathreplacing
مورد نیاز است.
\documentclass{article}
\usepackage{pgfplots}
\usetikzlibrary{patterns,decorations.pathreplacing}
\usepackage{xepersian}
\settextfont{Yas}
\setmathdigitfont{Yas}
\begin{document}
\begin{tikzpicture}
\begin{axis}[width=\textwidth,height=0.5\textwidth,
axis x line=bottom,
xmin=-1.4, xmax=1.4,
ymin=0, ymax=1.2,
xtick={-1,-0.5,...,1},
axis y line=middle,
xlabel={$x$},
ylabel={$C(x)$},
every axis x label/.style={at={(ticklabel* cs:1)}, anchor=west},
every axis y label/.style={at={(ticklabel* cs:1)}, anchor=south},
ytick={1},
]
\addplot[thick,,domain=-1:0,samples=500]{1-4*(x+0.5)^2};
\addplot[thick,,domain=0:1,samples=500]{1-4*(x-0.5)^2};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[width=\textwidth,height=0.5\textwidth,
axis x line=bottom,
xtick={-8,-6,...,16,18},
xmin=-10, xmax=20,
ymin=0, ymax=1.2,
axis y line=middle,
xlabel={$x$},
ylabel={$y$},
every axis x label/.style={at={(ticklabel* cs:1)}, anchor=west},
every axis y label/.style={at={(ticklabel* cs:1)}, anchor=south},
ytick={1},
]
\addplot[thick,domain=3:7,samples=500]{1-0.5*abs(x-5)} node[pos=.5,left] {$M$};
\addplot[thick,domain=5:9,samples=500]{1-0.5*abs(x-7)} node[pos=.5,right] {$N$};
\addplot[thick,dashed,domain=8:16,samples=500]{1-0.25*abs(x-12)} node[pos=.5,right] {$M \oplus N$};
\addplot[thick,dashed,domain=-6:2,samples=500]{1-0.25*abs(x+2)} node[pos=.5,left] {$M \ominus N$};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[width=\textwidth,height=0.5\textwidth,clip=false,
axis x line=bottom,
xtick={1},
xmin=0, xmax=1.1,
ymin=0, ymax=1.2,
axis y line=left,
xlabel={$x$},
extra x ticks={0,0.1,0.9},
extra x tick labels={$0$,$\frac{\alpha}{2}$,$1-\frac{\alpha}{2}$},
ylabel={$y$},
extra y ticks={0.2},
extra y tick labels={$\alpha$},
every axis x label/.style={at={(ticklabel* cs:1)}, anchor=west},
every axis y label/.style={at={(ticklabel* cs:1)}, anchor=south},
ytick={1},
]
\addplot[thick,domain=0:1,samples=500]{1-2*abs(x-0.5)} node[pos=.65,right,xshift=5mm] {$A(\theta)$};
\draw [help lines,dashed] (axis cs:0,0.2) -| (axis cs:0.9,0);
\draw [help lines,dashed] (axis cs:0,0.2) -| (axis cs:0.1,0);
\draw [thick,decoration={brace,mirror,raise=20pt,amplitude=10pt},decorate]
(axis cs:0.1,0) -- node[below=30pt] {$A_{\alpha}$} (axis cs:0.9,0);
\end{axis}
\end{tikzpicture}
\end{document}
نتیجه: