foreach how to fix the code below so that the center of the figure is at the origin (0,0)?
\begin{tikzpicture}
\fill[blue] circle (2pt) node[right] {$(0,0)$};
\draw (-3,1) -- (3,1);
\draw[blue] (-3,-2) -- (3,4);
\foreach \x in {1,2,3}{
\foreach \y in {1,...,\x}{
\draw[|-|] (\x,\y) -- ++(0,1);
};
};
\foreach \x in {1,2,3}{
\foreach \y in {1,...,\x}{
\draw[|-|] (-\x,-\y+1) -- ++(0,1);
};
};
\end{tikzpicture}

how to minimize the code? I minimize the code? See:
\begin{tikzpicture}
\fill[blue] circle (2pt) node[below right] {$(0,0)$};
\begin{scope}[yshift=-1cm]
\draw (-3,1) -- (3,1);
\draw[blue] (-3,-2) -- (3,4);
\foreach \x in {1,2,3}{
\foreach \y in {1,...,\x}{
\draw[|-|] (\x,\y) -- ++(0,1);
\draw[|-|] (-\x,-\y+1) -- ++(0,1);
};
};
\end{scope}
\end{tikzpicture}



