Reputation: 26671
When I wrote this program I first tried with matlab, then with gnu octave and they couldn't do it. So I wrote my own script for it in python:
from pylab import *
f, ax = plt.subplots(1)
xdata = [256, 512, 1024, 2048]
labels = [256, 512, 1024, 2048]
ydata = [1, 1, 30, 150]
plt.xscale('log', basex=2)
plt.yscale('log', basey=2)
ax.scatter(xdata, ydata)
y2data = [1, 1, 30, 150]
ax.scatter(xdata, y2data, marker='x')
x3data = [256, 512]
y3data = [29, 140]
ax.scatter(x3data, y3data, marker='d')
plt.xticks(xdata, labels, rotation='vertical')
f.suptitle('Benchmark results', fontsize=20)
plt.xlabel('memory (bytes)', fontsize=18)
plt.ylabel('time (seconds)', fontsize=16)
plt.show(f)
The graph looks alright (but I had to resize it to make the text at the bottom appear).
Now for the vertical exponential/logarithmic axis I would like to write it in decimal notation just like the horizontal axis. Can it be done?
Instead of "2²" I would like it to say just 4 plainly.
Upvotes: 0
Views: 95
Reputation: 1386
Why not just do the same thing you did for the horizontal axis? Create a list of labels manually and then set it using plt.yticks, and put the full numbers instead of powers of 2.
Upvotes: 1