0
\begin{tikzpicture}[scale=0.5]
        \draw [<->,thin] (-5,0) - - (5,0) node [right] {$x$};
        \draw [<->,thin] (0,-3) - - (0,3) node [above] {$y$};


      \draw[color=blue]   plot (\x,{sin(\x r)})   node[right] {$f(x) = \sin x$};
       \draw[color=red]   **plot (\x,{sin(\x r)})**   node[right] {$f(x) = \sin (x+2)$};       
       \end{tikzpicture} 

how can I draw the sin2x!!!!I already draw the sinx!! please help!!!

moewe
  • 175,683
lili
  • 1
  • 1
    Welcome! \draw[color=red,smooth] plot (\x,{sin(2+\x r)}) node[right] {$f(x) = \sin (x+2)$}; or \draw[color=orange,smooth] plot (\x,{sin(2*\x r)}) node[right] {$f(x) = \sin (x+2)$};? Note that in order to multiply two variables you need to use a *. –  May 05 '20 at 04:18
  • 1
    Try \documentclass[tikz,border=3mm]{standalone} \begin{document} \begin{tikzpicture}[scale=0.5] \draw [<->,thin] (-5,0) -- (5,0) node [right] {$x$}; \draw [<->,thin] (0,-3) -- (0,3) node [above] {$y$}; \draw[color=blue] plot (\x,{sin(\x r)}) node[right] {$f(x) = \sin x$}; \draw[color=red,smooth] plot (\x,{sin(2+\x r)}) node[right] {$f(x) = \sin (x+2)$}; \draw[color=orange,smooth] plot (\x,{sin(2*\x r)}) node[right] {$f(x) = \sin (x+2)$}; \end{tikzpicture} \end{document}. –  May 05 '20 at 04:21
  • how do I draw y=sin(x+2)??? \draw[color=red, smooth] plot (\x,{sin(2+\x r)}) node[right] {$f(x) = \sin (x+2)$}; this is not correct. thanks for the help!!! I appreciate it a lot! – lili May 05 '20 at 04:26
  • 1
    Maybe \draw[color=red,smooth] plot (\x,{sin(deg(2+\x))}) node[right] {$f(x) = \sin (x+2)$}; since TikZ uses degrees for the arguments of trigonometric functions? –  May 05 '20 at 04:40
  • It works!!! Thanks a lot!!! – lili May 05 '20 at 04:45
  • 1
    Great! Would you agree that your question is basically the same as this one? –  May 05 '20 at 04:48
  • I saw that one. Yes the {deg} is same! I did not read carefully,that's my bad – lili May 05 '20 at 04:49
  • 1
    No worries! So unless you say otherwise this question will then be closed as a duplicate. –  May 05 '20 at 04:50

0 Answers0