3

This is my code.

\documentclass[pstricks,border=10pt]{standalone}
\usepackage{pstricks-add,pst-plot,pst-func}
\begin{document}
    \def\funcone{6-x}
    \def\functwo{7-x}
    \begin{pspicture}(-1,-1)(8,8)
    \psplot[linestyle=dashed,linecolor=red,algebraic]{0}{6}{\funcone}
    \psplot[linestyle=dashed,linecolor=red,algebraic]{0}{7}{\functwo}
%   \psplotImp[linecolor=red,stepFactor=0.1](0,-1)(6,5){x^2+x*y+y^2-8*x-7*y+15}
    \psaxes[showorigin=false]{->}(0,0)(-.5,-.5)(8,8)[$x$,-90][$y$,0]%[labels=none,ticks=none]
    \psclip[linestyle=none]{%
        \psplotImp[stepFactor=0.1,algebraic](-1,-1)(7,7){ x^2+x*y+y^2-8*x-7*y+15 }}
        \pscustom[fillstyle=solid,fillcolor=green!80!orange,algebraic]{%
            \psplot{0}{6}{\funcone}
            \psplot{7}{0}{\functwo}
            \closepath}
    \endpsclip  
    \end{pspicture}
\end{document}

The ouput picture

enter image description here

It should be

enter image description here

Note: You can reproduce my code if you want to introduce several new things!

An other way using pst-contourplot!

\documentclass[pstricks,border=10pt]{standalone}
\usepackage{pst-contourplot,pstricks-add}
\begin{document}
    \def\funcone{6-x}
    \def\functwo{7-x}
    \begin{pspicture}(-1,-1)(8,8)
    \psaxes[showorigin=false]{->}(0,0)(-.5,-.5)(8,8)[$x$,-90][$y$,0]
    \psclip[linestyle=none,algebraic]{%
        \pscustom{\psplot{0}{6}{\funcone}   \psplot{7}{0}{\functwo}     \closepath} }
    \psContourPlot[algebraic,
                   a=0.05,
                   linecolor=red,
                   Fill,fillcolor=green!50!orange,
                   function=x^2+x*y+y^2-8*x-7*y+15](-1,-1)(7,7)
    \endpsclip
    \psplot[linestyle=dashed,linecolor=red,algebraic]{0}{6}{\funcone}
    \psplot[linestyle=dashed,linecolor=red,algebraic]{0}{7}{\functwo}
    \psContourPlot[algebraic,a=0.05,linecolor=red,function=x^2+x*y+y^2-8*x-7*y+15](-1,-1)(7,7)
    \end{pspicture}
\end{document}

enter image description here

2

You cannot use \pstPlotImp, the line isn't a function. That are only single dots. However, \psellipse[rot=-45](3,2)(2.85,1.65) is the same curve.

\documentclass[pstricks,border=10pt]{standalone}
\usepackage{pstricks-add}
\begin{document}
\begin{pspicture}(-1,-1)(8,8)
  \psaxes[showorigin=false]{->}(0,0)(-.5,-.5)(8,8)[$x$,-90][$y$,0]
  \psclip{\psellipse[rot=-45,linestyle=none](3,2)(2.85,1.65)}
    \pspolygon[linestyle=none,fillstyle=solid,fillcolor=red!50](6,0)(7,0)(0,7)(0,6)
  \endpsclip  
  \psellipse[rot=-45,linestyle=dashed](3,2)(2.85,1.65)
  \psset{linecolor=red,linestyle=dashed}
  \psline(7,0)(0,7)
  \psline(6,0)(0,6)
\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