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)

  • maybe tex.stackexchange.com/questions/105570/… can give you some starting points Commented Apr 11, 2017 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
    Commented Apr 11, 2017 at 14:01
  • well i can understand to get a graph but how to restrict on N? Commented Apr 11, 2017 at 14:06

1 Answer 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

\addplot [samples at={0,...,20},only marks] {x +sin(deg(x))};

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .