Graphics, Figures & TablesSine function and trig labels

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

Sine function and trig labels

Post by coachbennett1981 »

Good morning,

I am trying to plot the function y=3sin(4x) using pstricks. I am trying to change the values on the x-axis. The values from the origin to be \pi/8, 3\pi/8,\5pi/8, etc. The sine function will go through the origin and the max point (point 2) should be at \pi/8, however, I can't change the axis to make it happen. Here is my code and graph.

Code: Select all

\documentclass{article}
\usepackage{pstricks-add}
\usepackage{pst-func}

\begin{document}
\psset{trigLabels=true}
\begin{pspicture}(-0.5,-3)(6.5,4)
\psaxes[trigLabelBase=2,dx=\psPiH, xunit=\psPiTwo,trigLabels]{->}(0,0)(0,-3)(1,4)[$x$,0][$y$,90]
\psset{algebraic}
\psplot[linewidth=1.6pt,plotpoints=2000,
    linecolor=red,arrows=<->]{0}{6.28}{3*sin(4*x)}
\end{pspicture}
\end{document}
Any help would be appreciated. I have looked in the pstrikcs-add documentation and have tried changing dx=\psPiH and also the xunit, but I can't seem to get it to work.


Nick

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply