0

I want to know how do graph a vector field and a function in TeXStudio.

So far, I have tried:

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot}
\psset{algebraic,plotpoints=300}

\def\a{2}
\def\x(#1){\a*cos(#1)^3}
\def\y(#1){\a*sin(#1)^3}

\begin{document}
    \begin{pspicture}[showgrid=true](-2,-2)(2,2)
    \psparametricplot[linecolor=red]{0}{\psPiTwo}{\x(t)|\y(t)}
    \end{pspicture}
\end{document}

But I got some errors:

Undefined control sequence. ...egin{pspicture}[showgrid=true](-2,-2)(2,2)
Undefined control sequence. ...egin{pspicture}[showgrid=true](-2,-2)(2,2)
Undefined control sequence. ...egin{pspicture}[showgrid=true](-2,-2)(2,2)
Undefined control sequence. ...egin{pspicture}[showgrid=true](-2,-2)(2,2)
Undefined control sequence. ...egin{pspicture}[showgrid=true](-2,-2)(2,2)
Undefined control sequence. ...egin{pspicture}[showgrid=true](-2,-2)(2,2)
Undefined control sequence. ...t[linecolor=red]{0}{\psPiTwo}{\x(t)|\y(t)}
Undefined control sequence. ...t[linecolor=red]{0}{\psPiTwo}{\x(t)|\y(t)}
Undefined control sequence. ...t[linecolor=red]{0}{\psPiTwo}{\x(t)|\y(t)}
Undefined control sequence. ...t[linecolor=red]{0}{\psPiTwo}{\x(t)|\y(t)}

Also, I read this question Easiest way to plot a function with PGF/TikZ and copy each code in a new page. All of them don't work.

Can someone tell me why and how to do in TeXStudio?

Thanks!

Simple
  • 111

0 Answers0