Graphics, Figures & TablesSmooth Curve for Sine Function

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Smooth Curve for Sine Function

Post by coachbennett1981 »

Good morning from the District of Columbia!!! I plotted the following function, but the line is not a smooth curve. Does anyone have suggestions on how to fix this problem?

Code: Select all

\psset{trigLabels=true,labelFontSize=\scriptstyle,xunit=\pstRadUnit}
\begin{pspicture}(-\psPiTwo,-4)(10,4)
\psaxes[trigLabelBase=2]{<->}(0,0)(-\psPiTwo,-5)(\psPiTwo,5)
\psplot[xunit=1cm,linecolor=red,linewidth=1.5pt]{-\psPiTwo}{\psPiTwo}{x 2 mul 3.14159265 add RadtoDeg cos 2 mul 2 sub}
Best,

Nick

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Smooth Curve for Sine Function

Post by localghost »

Ever heard of the plotpoints option for the graphics commands? If not, search the PSTricks manual.

Code: Select all

texdoc pstricks

Best regards
Thorsten
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Smooth Curve for Sine Function

Post by CrazyHorse »

coachbennett1981 wrote:Good morning from the District of Columbia!!! I plotted the following function, but the line is not a smooth curve. Does anyone have suggestions on how to fix this problem?

Code: Select all

\psset{trigLabels=true,labelFontSize=\scriptstyle,xunit=\pstRadUnit}
\begin{pspicture}(-\psPiTwo,-4)(10,4)
\psaxes[trigLabelBase=2]{<->}(0,0)(-\psPiTwo,-5)(\psPiTwo,5)
\psplot[xunit=1cm,linecolor=red,linewidth=1.5pt]{-\psPiTwo}{\psPiTwo}{x 2 mul 3.14159265 add RadtoDeg cos 2 mul 2 sub}
plotpoints=1000

Herbert
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Re: Smooth Curve for Sine Function

Post by coachbennett1981 »

Thank both of you for your input
Post Reply