1

I want to plot f(n)=n+sin(n)function restricting the domain in the set of natural numbers. I need the code for beamer presentation. Is there any software that would generate the graph as well as export the code. Please help me how can i do this ( Explaination in non technical language is welcome)

Torbjørn T.
  • 206,688
  • maybe http://tex.stackexchange.com/questions/105570/how-to-plot-functions-like-x-fy-using-tikz can give you some starting points – samcarter_is_at_topanswers.xyz Apr 11 '17 at 13:41
  • 1
    I assume, that you like to draw in LaTeX ... In this case you first need select package by which you will draw your graph (tikz, pgfplots, pstricks, ...). Then you should define domain of your function and look for examples of graphs drawn with selected package. Drawing with any of mentioned package is independent from document class. – Zarko Apr 11 '17 at 14:01
  • well i can understand to get a graph but how to restrict on N? – Pedrick Serre Apr 11 '17 at 14:06

1 Answers1

1

With pgfplots you can decide which x-values you want the function calculated for with the samples at key, and you plot only markers with the only marks key.

enter image description here

\documentclass{beamer}
\usepackage{pgfplots}
\pgfplotsset{compat=1.14}
\begin{document}
\begin{frame}
\centering
\begin{tikzpicture}
\begin{axis}[xlabel=Radians,ylabel=$n+\sin(n)$]
\addplot [samples at={0,...,20},only marks] {x +sin(deg(x))};
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}
Torbjørn T.
  • 206,688