Fork of https://github.com/oxigraph/oxigraph.git for the purpose of NextGraph project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
oxigraph/bench/bsbm-plot.py

27 lines
810 B

import xml.etree.ElementTree as ET
import matplotlib.pyplot as plt
from collections import defaultdict
from glob import glob
def plot_y_per_x_per_plot(data, xlabel, ylabel, file):
for label, xys in data.items():
plt.plot(list(xys.keys()), list(xys.values()), '.', label=label)
plt.legend()
plt.xlabel(xlabel)
plt.ylabel(ylabel)
# plt.yscale('log')
plt.savefig(file)
plt.show()
aqet = defaultdict(dict)
for file in glob('bsbm.explore.*.xml'):
run = file.replace('bsbm.explore.', '').replace('.xml', '')
for query in ET.parse(file).getroot().find('queries').findall('query'):
val = float(query.find('aqet').text)
if val > 0:
aqet[run][int(query.attrib['nr'])] = val
plot_y_per_x_per_plot(aqet, 'query id', 'aqet', 'bsbm.explore.png')