4

I plot an implicit function with pst-func. I choose dotted line style, but the output does not show what i expect.

Where is my mistake?

(By the way, I find only dotted and dashed options for line styles but i need more options.)

Minimal example:

\documentclass[pstricks,border=14pt,14pt]{standalone} 
\usepackage{pst-func} 

\def\tt{1}
\begin{document} 
\begin{psgraph}[Dx=1,Dy=1](0,0)(-2,-2)(2,2){4cm}{4cm}
    \psplotImp[algebraic,linestyle=dotted,linecolor=red,stepFactor=.3](-1.5,-1.5)(1.5,1.5)
    {(abs(x)+abs(y))-\tt}
\end{psgraph}
\end{document}

enter image description here

  • dotted line style is not possible for implicit defined functions. The reason is that the function is internally plotted as dots and the space between two dots cannot really be controlled. – user2478 Jul 13 '18 at 4:53
2

Play around with the stepFactor

\documentclass[pstricks,border=14pt,14pt]{standalone}
\usepackage{pst-func,pstricks-add}

\def\tt{1}
\begin{document}
\begin{psgraph}[Dx=1,Dy=1](0,0)(-2,-2)(2,2){4cm}{4cm}
    \psplotImp[algebraic,linestyle=dotted,linecolor=red,stepFactor=0.97](-1.5,-1.5)(1.5,1.5)
    {(abs(x)+abs(y))-\tt}
\end{psgraph}

\begin{pspicture}(-2,-2)(2,2)
\psaxes{->}(0,0)(-2,-2)(2,2)[$x$,0][$y$,90]
\pspolygon[linecolor=red,linestyle=dotted](0,-1)(1,0)(0,1)(-1,0)
\end{pspicture}
\end{document}

For that easy example I would recommend a \pspolygon see second picture.

enter image description here enter image description here

  • Thanks for your reply. Actually, i need to plot different type of implicit functions which can not be expressed as simple segments. – mert Jul 12 '18 at 6:35

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.