سلام
روش 1: نمودار رو با استفاده از بسته tikz
رسم کردم بصورت زیر:
\documentclass[12pt,a4paper]{report}
\usepackage{tikz,amsmath,color}
\usepackage{xepersian}
\settextfont{XB Zar}
\setdigitfont{Yas}
\linespread{1.25}
\begin{document}
\begin{figure}[ht]
\centering
\begin{tikzpicture}[scale=1,thick]
\draw [->,>=stealth](-1,0)--(9,0)node[above] {$x$};
\draw [->,>=stealth](0,-3)--(0,3)node[left] {$y$};
\draw [color=blue,ultra thick] (-1,0)--(0,0)--(0,2)--(1,2)--(1,-2)--(2,-2)--(2,0)--(8.5,0);
\draw [red] (.5,0) node{$\times$};
\draw [red] (1.5,0) node{$\times$};
\draw [red](2.5,0) node{$\times$};
\draw [red](3.5,0) node{$\times$};
\draw [red](4.5,0) node{$\times$};
\draw [red](5.5,0) node{$\times$};
\draw [red](6.5,0) node{$\times$};
\draw [red](7.5,0) node{$\times$};
\foreach \x/\xtext in {0.5/\frac{1}{8}, 1/\frac{2}{8}, 1.5/\frac{3}{8}, 2/\frac{4}{8},2.5/\frac{5}{8},3/\frac{6}{8},3.5/\frac{7}{8},4/1}
\draw[shift={(\x,0)}] (\x,.1)--(\x,-.1)node[below left] {$\xtext$} ;
\foreach \y/\ytext in {-2/-1,2/1}
\draw[shift={(0,\y)}] node[left] {$\ytext$} ;
\end{tikzpicture}
\caption{\small{$ \psi_{2,0}=h_5(x)$}}
\end{figure}
\end{document}
خروجی:
روش 2: در پرسش زیر قرار دادم:
http://qa.parsilatex.com/9694/
روش 3: دستوراتی که در فایل کمینه قرار دادهاید:
\documentclass[12pt,a4paper]{report}
\usepackage{pgfplots,tikz,amsmath}
\let\ds\displaystyle
\usepackage{subfigure}
\usepackage{color}
\usepackage{xepersian}
\settextfont{XB Zar}
\setdigitfont{Yas}
\linespread{1.25}
\begin{document}
\begin{figure}[htp]
\centering
\begin{tikzpicture}
\begin{axis} [
axis lines=middle,
inner axis line style={=>},
xlabel={\large $x$},
ylabel={\large $y$},
xticklabel style={inner xsep=.5pt, anchor=north east},
xtick={0,0.125,...,1.1},
ytick={-1,0,1},
xticklabel style={/pgf/number format/.cd,frac,frac TeX=\ds\frac,frac denom=8},
yticklabel style={/pgf/number format/.cd,frac,frac TeX=\ds\frac,frac denom=1},
ymin=-1.2,
ymax=1.2,
xmin=-0.1,
xmax=1.2]
\addplot[color=blue,ultra thick] coordinates {
(-0.1,0)
(0,0)
(0,1)
(1/8,1)
(1/8,-1)
(2/8,-1)
(2/8,0)
(1.125,0)
};
\end{axis}
\node [red] at (.85,2.85) {$\times$};
\node [red] at (1.5,2.85) {$\times$};
\node [red] at (2.17,2.85) {$\times$};
\node [red] at (2.85,2.85) {$\times$};
\node [red] at (3.5,2.85) {$\times$};
\node [red] at (4.15,2.85) {$\times$};
\node [red] at (4.8,2.85) {$\times$};
\node [red] at (5.45,2.85) {$\times$};
\end{tikzpicture}
\caption{\small{$ \psi_{2,0}=h_5(x)$}}
\end{figure}
\end{document}
خروجی: