#!/usr/bin/env python2

import matplotlib.pyplot as plt
import numpy as np

import re
import itertools
from collections import OrderedDict

from sys import argv, exit

MARKERS = ['.', '>', '<', '*', 'v', '^', 'D', 'X', 'P', 'p', 's']

data = OrderedDict()

mark = []

for arg in argv[1:]:
    label = arg
    filename = arg
    if ":" in arg:
        label, filename = arg.split(":")
    data[label] = []

    with open(filename, 'r') as f:
        for line in f.readlines():
            try:
                val = float(line.strip().replace(',', ''))
                data[label].append(val)
            except ValueError:
                print("bad float: %s" % line)

            if line[0] == '=':
                mark.append(len(data[label]))

fig, ax = plt.subplots()

markers = itertools.cycle(MARKERS)

handles = []

for i, (label, ys) in enumerate(data.items()):
    ys = np.diff(ys)
    xs = np.arange(len(ys))
    h_plot, = ax.plot(xs, ys, label = label, linestyle = 'None', marker = markers.next(), color = np.random.rand(3,))

    handles.append(h_plot)

for m in mark:
    plt.axvline(x=m, color = 'red')

#ax.set_ylim((0,100000))

plt.title('Latency of Operations as Memory Usage Increases')

plt.legend(handles=handles)

#fig.tight_layout()  # otherwise the right y-label is slightly clipped
plt.show()

6e5e6f3f3a9a648795ee471fcf4e54253b9b1a89
<mask token>

<mask token>
for arg in argv[1:]:
    label = arg
    filename = arg
    if ':' in arg:
        label, filename = arg.split(':')
    data[label] = []
    with open(filename, 'r') as f:
        for line in f.readlines():
            try:
                val = float(line.strip().replace(',', ''))
                data[label].append(val)
            except ValueError:
                print('bad float: %s' % line)
            if line[0] == '=':
                mark.append(len(data[label]))
<mask token>
for i, (label, ys) in enumerate(data.items()):
    ys = np.diff(ys)
    xs = np.arange(len(ys))
    h_plot, = ax.plot(xs, ys, label=label, linestyle='None', marker=markers
        .next(), color=np.random.rand(3))
    handles.append(h_plot)
for m in mark:
    plt.axvline(x=m, color='red')
plt.title('Latency of Operations as Memory Usage Increases')
plt.legend(handles=handles)
plt.show()

<mask token>
MARKERS = ['.', '>', '<', '*', 'v', '^', 'D', 'X', 'P', 'p', 's']
data = OrderedDict()
mark = []
for arg in argv[1:]:
    label = arg
    filename = arg
    if ':' in arg:
        label, filename = arg.split(':')
    data[label] = []
    with open(filename, 'r') as f:
        for line in f.readlines():
            try:
                val = float(line.strip().replace(',', ''))
                data[label].append(val)
            except ValueError:
                print('bad float: %s' % line)
            if line[0] == '=':
                mark.append(len(data[label]))
fig, ax = plt.subplots()
markers = itertools.cycle(MARKERS)
handles = []
for i, (label, ys) in enumerate(data.items()):
    ys = np.diff(ys)
    xs = np.arange(len(ys))
    h_plot, = ax.plot(xs, ys, label=label, linestyle='None', marker=markers
        .next(), color=np.random.rand(3))
    handles.append(h_plot)
for m in mark:
    plt.axvline(x=m, color='red')
plt.title('Latency of Operations as Memory Usage Increases')
plt.legend(handles=handles)
plt.show()

import matplotlib.pyplot as plt
import numpy as np
import re
import itertools
from collections import OrderedDict
from sys import argv, exit
MARKERS = ['.', '>', '<', '*', 'v', '^', 'D', 'X', 'P', 'p', 's']
data = OrderedDict()
mark = []
for arg in argv[1:]:
    label = arg
    filename = arg
    if ':' in arg:
        label, filename = arg.split(':')
    data[label] = []
    with open(filename, 'r') as f:
        for line in f.readlines():
            try:
                val = float(line.strip().replace(',', ''))
                data[label].append(val)
            except ValueError:
                print('bad float: %s' % line)
            if line[0] == '=':
                mark.append(len(data[label]))
fig, ax = plt.subplots()
markers = itertools.cycle(MARKERS)
handles = []
for i, (label, ys) in enumerate(data.items()):
    ys = np.diff(ys)
    xs = np.arange(len(ys))
    h_plot, = ax.plot(xs, ys, label=label, linestyle='None', marker=markers
        .next(), color=np.random.rand(3))
    handles.append(h_plot)
for m in mark:
    plt.axvline(x=m, color='red')
plt.title('Latency of Operations as Memory Usage Increases')
plt.legend(handles=handles)
plt.show()

#!/usr/bin/env python2

import matplotlib.pyplot as plt
import numpy as np

import re
import itertools
from collections import OrderedDict

from sys import argv, exit

MARKERS = ['.', '>', '<', '*', 'v', '^', 'D', 'X', 'P', 'p', 's']

data = OrderedDict()

mark = []

for arg in argv[1:]:
    label = arg
    filename = arg
    if ":" in arg:
        label, filename = arg.split(":")
    data[label] = []

    with open(filename, 'r') as f:
        for line in f.readlines():
            try:
                val = float(line.strip().replace(',', ''))
                data[label].append(val)
            except ValueError:
                print("bad float: %s" % line)

            if line[0] == '=':
                mark.append(len(data[label]))

fig, ax = plt.subplots()

markers = itertools.cycle(MARKERS)

handles = []

for i, (label, ys) in enumerate(data.items()):
    ys = np.diff(ys)
    xs = np.arange(len(ys))
    h_plot, = ax.plot(xs, ys, label = label, linestyle = 'None', marker = markers.next(), color = np.random.rand(3,))

    handles.append(h_plot)

for m in mark:
    plt.axvline(x=m, color = 'red')

#ax.set_ylim((0,100000))

plt.title('Latency of Operations as Memory Usage Increases')

plt.legend(handles=handles)

#fig.tight_layout()  # otherwise the right y-label is slightly clipped
plt.show()
