2

The first question.

Why can't we use linestyle=none for \psContourPlot in the following example?

\documentclass[pstricks,border=10pt]{standalone}
\usepackage{pst-contourplot,pstricks-add,pst-eucl,pst-intersect}
\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[algebraic,linestyle=none]{%
        \pscustom{\psplot{0}{6}{\funcone}   \psplot{7}{0}{\functwo}     \closepath} }
    \psContourPlot[a=0.05,algebraic,
                   Fill,fillcolor=green!50!orange,
                   function=x^2+x*y+y^2-8*x-7*y+15](-1,-1)(7,7)
    \endpsclip
    \end{pspicture}
\end{document}

enter image description here

The second question.

\documentclass[pstricks,border=10pt]{standalone}
\usepackage{pst-contourplot,pstricks-add,pst-eucl,pst-intersect}
\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[algebraic,linestyle=none]{%
        \pscustom{\psplot{0}{6}{\funcone}   \psplot{7}{0}{\functwo}     \closepath} }
    \psContourPlot[a=0.05,algebraic,
                   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)
    %%%
    \pnodes(1,4){A}(5,0){B}
    \psline(A)(B)
    \pstMiddleAB[PointName=none]{A}{B}{K} \uput[0](K){$K(3,2)$}
    \pstRotation[PosAngle=90,RotAngle=90]{K}{A}[C]
    %%%%
    \pssavepath{line}{\psline(K)(C)}
    \pssavepath{func}{\psContourPlot[algebraic,a=0.05,linestyle=none,function=x^2+x*y+y^2-8*x-7*y+15](-1,-1)(7,7)}
%   \psintersect[showpoints,name=C]{line}{func}
    \end{pspicture}
\end{document}

I see a message that has content as following: enter image description here

My aim is intersection...

enter image description here

1
  • \pssavepath can only handle commands, which are also allowed inside of \pscustom.
    – Christoph
    Oct 7 '19 at 15:15
2

Same problem here. Use the identical curve defined as an ellipse:

\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=dashed](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)
  \psset{linecolor=blue,linestyle=dashed}
  \pnode(!2.85 -45 PtoC 2 add exch 3 add exch){A0}\psdot(A0)
  \pnode(!-2.85 -45 PtoC 2 add exch 3 add exch){A1}\psdot(A1)
  \pnode(!1.65 45 PtoC 3 add exch 2 add ){B0}\psdot(B0)
  \pnode(!-1.65 45 PtoC 3 add exch 2 add){B1}\psdot(B1)
  \pcline[nodesep=-5mm](A0)(A1)
  \pcline[nodesep=-5mm](B0)(B1)
\end{pspicture}
\end{document}

enter image description here

1
  • Yes, I see ah. For drawing contourplot, Asymptote is the best choice!
    – user197952
    Oct 7 '19 at 13:13

Your Answer

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