import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid.axislines import Subplot gpu_data = np.loadtxt('throughput.gpu') cpu_data = np.loadtxt('throughput.cpu') fig = plt.figure(1, (8,4)) ax = Subplot(fig, 111) fig.add_subplot(ax) plt.rc('font', **dict(family='serif')) #plt.figure(figsize=(8, 4)) ax.semilogx(gpu_data[:,0], gpu_data[:,1], '*-', color='#3b5b92', label='GPU Memory') ax.semilogx(cpu_data[:,0], cpu_data[:,1], 'o-', color='#77DD77', label='Main Memory') ax.axis["right"].set_visible(False) ax.axis["top"].set_visible(False) plt.ylim(0, 7000) plt.xticks([1e4,1e6,1e8,1e10]) plt.yticks([0,2000,4000,6000]) plt.xlabel('Data size (B)') plt.ylabel('Throughput (MB/s)') plt.legend(loc='lower right',frameon=False) plt.savefig('throughput.pdf', dpi=300, bbox_inches='tight')