1

How can I make a plot in Gnuplot like those seen here: http://www.fftw.org/accuracy/G4-1.06GHz-gcc3.4/, i.e. with an explicit x axis? I have a dataset like this:

2   1066.7
4   3122.9
8   4715.2
16  5538.5
32  5757.3
64  5891.4
128 5398.3
256 5280.2
512 5178.4
1024    4048.6
2048    4383
4096    3794.4

Everytime I plot, the x-axis is a linear scale so all of my values are bunched up against the y axis. I want each x value to be equally spaced, like in the linked plots. Thanks.

3
  • 1
    Why is this tagged with fftw and python? Commented Aug 22, 2012 at 14:56
  • The plot I am trying to recreate is from FFTW's website, using FFTW benchmark results. I am using Python to call Gnuplot. Sorry for improperly using tags. Commented Aug 22, 2012 at 15:18
  • No problem. I removed the tags which are unnecessary. If you were also looking for a python/matplotlib solution, we could add those tags back on. Commented Aug 22, 2012 at 15:19

2 Answers 2

13

In gnuplot, you need to tell it to use logscale axes (base 2)

set logscale x 2
set xtics 2 #label powers of 2 instead of the default
plot 'dataset.dat' w lines
Sign up to request clarification or add additional context in comments.

Comments

2

Your x axis should have an logarithmic scale. You can set it with respect to 2 with

set logscale x 2

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.