[Tex/LaTex] How to draw a square wave

pstrickstikz-pgf

Everything is in the title…

I'm trying to draw a simple square wave , but I'm reading that tikz cannot draw the vertical line of the discontinuity…

Is there a way to overpass this ? PSTricks maybe ?

This is what I'm trying to represent :

what I'm trying to do

Best Answer

Without TikZ.

enter image description here

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot}

\begin{document}
\begin{pspicture}(-1,-1)(9,3)   
    \psaxes{->}(0,0)(-1,-1)(8.5,2.5)[$x$,0][$y$,90]
    \multips(0,0)(2,0){4}{\psline[linecolor=red](0,2)(1,2)(1,0)(2,0)(2,2)}
\end{pspicture}
\end{document}