# Removing a segment of a frame

I have the following MWE in PSTricks, showing a rectangle:

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

\usepackage{siunitx}
\begin{document}
\begin{pspicture}[showgrid=true](5,5)
\psframe(4,4)
\end{pspicture}
\end{document}


What I would like to is to remove the part of the right side spanned by the coordinates (4,1) and (4,3). What is the easiest way to achieve this? I could of course just superimpose a white line, but that seems like a wrong way to do it.

-
@PGFTricks: You are wrong! pst-node has nothing to do with coordinate types, except nodes! – Herbert Oct 7 '13 at 8:50

a "correct" way is to draw a polyline:

\psline(4,1)(4,0)(0,0)(0,4)(4,4)(4,3)


and if you want to fill the area use:

\psframe*[linecolor=cyan!40](4,4)
\psline(4,1)(4,0)(0,0)(0,4)(4,4)(4,3)

-
is there a way to remove the horizontal lines at points (4, 1) and (4,3)? – BillyJean Oct 7 '13 at 8:45
sorry, I do not understand what lines do you mean. At (4, 1) and (4,3) are no horizontal lines – Herbert Oct 7 '13 at 8:48

Just another answer with PSTricks. But the boundary of the filled region passes the middle of the line, you can see it easily by changing linewidth=5\pslinewidth, for example.

\documentclass[pstricks,border=12pt]{standalone}
\begin{document}
\begin{pspicture}(4,4)
\pscustom[fillstyle=solid,fillcolor=gray]
{
\psline(4,3)(4,4)(0,4)(0,0)(4,0)(4,1)
}
\end{pspicture}
\end{document}


Apparently the code above is equivalent to the following (based on Herbert's surprising comment below).

\documentclass[pstricks,border=12pt]{standalone}
\begin{document}
\begin{pspicture}(4,4)
\psline[fillstyle=solid,fillcolor=gray](4,3)(4,4)(0,4)(0,0)(4,0)(4,1)
\end{pspicture}
\end{document}


Or with an overkill solution below.

\documentclass[pstricks,border=12pt]{standalone}
\begin{document}
\begin{pspicture}(4,4)
\pscustom
{
\psline(4,3)(4,4)(0,4)(0,0)(4,0)(4,1)
\gsave
\closepath
\fill[fillstyle=solid,fillcolor=gray]
\grestore
}
\end{pspicture}
\end{document}


-
\psline[fillstyle=solid,fillcolor=gray](4,3)... does the same without \pscustom. – Herbert Oct 7 '13 at 13:43