\documentclass[12pt,pstricks,border=5pt]{standalone}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}(-7,-1.5)(7,1.5)
\psaxes[trigLabels=true,trigLabelBase=2,dx=\psPiH,xunit=\psPi]{->}(0,0)(-2.2,-1.5)(2.2,1.5)
\psplot[linecolor=red,linewidth=1.5pt,algebraic,plotstyle=curve]{-7}{7}{sin(x)}
\end{pspicture}
\end{document}
如何将轴标签从弧度更改为度(例如,从-360^\circ
,,-270^\circ
...,360^\circ
)?
答案1
\documentclass[12pt,pstricks,border=5pt]{standalone}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}(-7,-1.5)(7,1.5)
\psaxes[Dx=90,dx=\psPiH,xunit=\psPi,xlabelFactor={}^\circ]{->}(0,0)(-2.2,-1.5)(2.2,1.5)
\psplot[linecolor=red,linewidth=1.5pt,algebraic,plotpoints=100]{-7}{7}{sin(x)}
\end{pspicture}
\end{document}