import matplotlib.pyplot as plt
import numpy as np

log = np.loadtxt("logproc")

fig, axm = plt.subplots()

colm = 'tab:orange'
axm.set_xlabel('number of @ tokens')
axm.set_ylabel('time (s)', color=colm)
axm.semilogy(log[:,0], log[:,1], marker='.', color=colm)
axm.tick_params(axis='y', labelcolor=colm)

axm = axm.twinx()
colm = 'tab:blue'
axm.set_xlabel('number of @ tokens')
axm.set_ylabel('max memory usage (MiB)', color=colm)
axm.semilogy(log[:,0], log[:,2], marker='.', color=colm)
axm.tick_params(axis='y', labelcolor=colm)

fig.tight_layout()
plt.savefig('plot.svg')
plt.savefig('plot.png', dpi=300)
