imbaer
imbaer

Reputation: 554

gnuplot move data point on x axis

i am plotting the attached graph using following script and data set:

set term postscript enhanced color solid
set output "speedup_v1.ps" 
set title "Speedup"
set key left top
set yrange[0:128]
set xtics (0,1,2,4,8,16,32,64,128)
set xlabel 'Processes'
set ylabel 'Speedup'
plot 'speedup_v1.dat' using 1:2 title "Speedup" with linespoints, \
     'speedup_v1.dat' using 1:3 title "Speedup (linear)" with linespoints

0    0     0
1    1     1
2    1,692 2
4    3,675 4
8    7,739 8
16   9,840 16
32   18,61 32
64   42,77 64
128  82,43 128

I would like to remain the graph like it is right now but the data points on the x axis should have the same distance between each other. Right now 64p -> 128p eats up half of the screen, i want it to be 1/8. Thanks in advance!

Plot

Upvotes: 2

Views: 1741

Answers (2)

Tom
Tom

Reputation: 5299

Also have a look at things like

set size square

that makes the plot square (predictably enough),

The set size command is particularly useful if you want to make the text bigger (in your graph it is a bit small).

You can do things like

set size 0.5, 0.5

and this reduces the size of the graph by half, but not the size of the text.

Upvotes: 0

Woltan
Woltan

Reputation: 14023

I would like to remain the graph like it is right now but the data points on the x axis should have the same distance between each other.

The "look" of a graph depends on the way the axis are formated. If you want the x-axis to be spread evenly, then the look of the graph will differ.

I suppose you are looking for a logscale? Try issuing the command

set logscale x

and see how the values will equally spread over the x-axis. Please note, that the logscale will only work in your case, since your data is spread logarithmically.

I hope this is what you were looking for

cherio Woltan

Upvotes: 3

Related Questions