Being a beginner, I'm having difficulty in plotting |sinx|. Can anyone help me with plotting y=|sinx| in [0,2pi] and y=0 elsewhere in tikz?

  • Please show the code you have tried so far!
    – Mensch
    Dec 2, 2021 at 14:30
  • Sir I used package tikzpicture and I couldn't proceed after \begin{tikzpicture} \end{tikzpicture}.
    – UserA
    Dec 2, 2021 at 14:32
  • I suggest looking the related package pgfplots and its documentation. Dec 2, 2021 at 14:34
  • You can try looking here or here or here or here or Google: plot function tikz
    – Sandy G
    Dec 2, 2021 at 21:36
  • Also, pgfplots would use abs(sin(x)) to calculate y. Look up Part VIII in the pgf manual and subsection 4.4.3 in the pgfplots manual. Dec 2, 2021 at 21:56


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.