普通视图
放大视图
“最小”代码片段
\documentclass[11pt,rgb]{article}
\usepackage{pst-func}
\renewcommand\pshlabel[1]{{\color{gray}\tiny#1}}
\renewcommand\psvlabel[1]{{\color{gray}\tiny#1}}
\usepackage{graphicx}
\usepackage{bera}
\begin{document}
\noindent\scalebox{2}{%
\begin{pspicture*}[showgrid=false](-3,-3)(3,3)
\psframe[fillcolor=black,fillstyle=solid](-3,-3)(3,3)
\psaxes
[%
linecolor=gray,
tickcolor=gray,
linewidth=0.25pt,
xlabelPos=top,
xticksize=-0.05 0.05,
yticksize=-0.05 0.05%
]{<->}(0,0)(-2,-1.75)(2,2)[$\color{gray}x$,0][$\color{gray}y$,90]
\rput[br](-1.75,1.5){\Large\bf\color{cyan}We}
\rput(1.75,-1){\Large\bf\color{white}PSTricks}
\psplotImp[linecolor=red,linewidth=0.5pt](-2.5,-1.75)(2.5,2.5)%
{x 2 exp 1.25 y mul x abs sqrt sub 2 exp add 2.5 sub}
\rput(0,-2.25){\color{yellow}$x^2 + \left(\frac{5y}{4}-\sqrt{|x|}\right)^2=\frac{5}{2}$}
\end{pspicture*}}
\end{document}
我注意到生成的曲线不关于 y 轴对称。它实际上必须关于 y 轴对称。
答案1
那不是一个最小例子 ...
\documentclass{article}
\usepackage{pst-func}
\begin{document}
\noindent\psscalebox{2}{%
\begin{pspicture*}(-3,-3)(3,3)
\psaxes[
linecolor=gray,
tickcolor=gray,
linewidth=0.25pt,
xlabelPos=top,
labelFontSize=\scriptscriptstyle,
labelsep=2pt,
ticksize=-0.05 0.05
]{<->}(0,0)(-2,-1.75)(2,2)[$\color{gray}x$,0][$\color{gray}y$,90]
\psplotImp[linecolor=red,linewidth=0.5pt,stepFactor=0.2,
algebraic](-2.5,-1.75)(2.5,2.5){x^2+(5*y/4-sqrt(abs(x)))^2-2.5}
\end{pspicture*}}
\end{document}
答案2
与参数表示法的简单函数相同:
\documentclass{article}
\usepackage{pst-func}
\begin{document}
\begin{pspicture*}(-3,-3)(3,3)
\psaxes[linewidth=0.25pt,
xlabelPos=top,
labelFontSize=\scriptscriptstyle,
labelsep=2pt,
ticksize=0.05]{<->}(0,0)(-2,-1.75)(2,2)[$x$,0][$y$,90]
\pscustom[fillstyle=solid,fillcolor=red,opacity=0.4,
linecolor=red,linewidth=1pt,algebraic]{%
\psparametricplot{0}{2.5 .25 exp}{t^2 | 0.8*(sqrt(2.5-t^4)+t)}
\psparametricplot{2.5 .25 exp}{0}{t^2 | 0.8*(-sqrt(2.5-t^4)+t)}
\psparametricplot{0}{2.5 .25 exp}{-t^2 | 0.8*(-sqrt(2.5-t^4)+t)}
\psparametricplot{2.5 .25 exp}{0}{-t^2 | 0.8*(sqrt(2.5-t^4)+t)}
}
\end{pspicture*}
\end{document}
答案3
静态版本:
简化现有的答案。
\documentclass[border=12pt,pstricks]{standalone}
\usepackage{pst-plot}
\def\x(#1){sin(#1)^3}
\def\y(#1){(13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t))/16}
\psset{algebraic,plotpoints=100}
\begin{document}
\begin{pspicture}[showgrid=bottom](-2,-2)(2,2)
\psparametricplot[origin={0,0.15}]{0}{\psPiTwo}{\x(t)|\y(t)}
\end{pspicture}
\end{document}
动画版:
\documentclass[border=12pt,pstricks]{standalone}
\usepackage{pst-plot}
\usepackage[nomessages]{fp}
\FPeval\Delta{round(2*pi/30:2)}
\def\x(#1){sin(#1)^3}
\def\y(#1){(13*cos(t)-5*cos(2*t)-2*cos(3*t)-cos(4*t))/16}
\psset{algebraic,plotpoints=100}
\begin{document}
\multido{\n=0.00+\Delta}{31}{%
\begin{pspicture}[showgrid=false](-1.5,-1.5)(1.5,1.5)
\psparametricplot[origin={0,0.15},linecolor=red]{0}{\n}{\x(t)|\y(t)}
\end{pspicture}}
\end{document}