Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

In gnuplot, how do you change the number of points when plotting a function

I’m using gnuplot to plot a cosine function over a lot of periods

However, the output is very scribbly, because gnuplot uses a low number of points to plot a function. Is there any way to adjust this to include more points?

Output that shows a blocky cosine-function due to low sampling

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

This is my very minimal code:

set xrange [0:50]
plot cos(x) with linespoints

I tried googling for the answer but I could not find any way to set the number of points when plotting a function. Is there any way to adjust this to include more points, apart from generating my own data table in excel or similar?

>Solution :

Well, I can’t believe that you haven’t found anything searching the web. This is really a RT*M question: (check help samples).

For example:

set samples 500
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading