6

The pspicture

enter image description here

comes from the code

\documentclass[12pt]{book}
\textheight=8.75in
\usepackage{xcolor,pstricks}

\begin{document}
\thispagestyle{empty}

\begin{pspicture}(-4,-4)(4,8)%
\psframe[fillcolor=blue,fillstyle=solid](-4,-4)(4,8)
%\rput(-4,0){}
\end{pspicture}%
\end{document} 

I would like to add to this picture, a (yellow) isosceles trapezoid with the longer base (8 units) along the entire width of the bottom of the rectangle, and with shorter base exactly 6 units in length. The height of the trapezoid is to be 3 units. In other words, I would like to draw within the pspicture, a trapezoid with vertices (-4,-4), (-3, -1), (3,-1), and (4,-4) and fill it with the color yellow. How may I do this? Is tikz required?

1 Answer 1

4

This is vert easy with the \pspolygon* command:

    \documentclass[12pt]{book}
    \textheight=8.75in
    \usepackage{xcolor,pstricks}

    \begin{document}

    \thispagestyle{empty}
    \psset{linejoin=1}
    \begin{pspicture}(-4,-4)(4,8)%
    \psframe[fillcolor=blue,fillstyle=solid](-4,-4)(4,8)
    \pspolygon*[linecolor=yellow](-4,-4)(-3,-1)(3,-1)(4,-4)
    \end{pspicture}%

    \end{document} 

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.