<commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
	This software is implemented as part of the course Dynamic Algorithms 
	(Q4 2015) at Aarhus Univerity Denmark. 

	stat.py
	Used to create plots of execution times.
	
	Stronly inspired by http://stackoverflow.com/a/16598291/4620080

	Author: <NAME> and <NAME>
"""
from pylab import plot, show, savefig, xlim, figure, \
                hold, ylim, legend, boxplot, setp, axes, \
                title, ylabel, xlabel, subplots_adjust, suptitle

from utils import get_test_cases, get_test_case
from sys import argv
import numpy as np
# Built-in colors: Blue, Green, Red,
# Cyan, Magenta, Yellow and Black
colors = "bgrcmyk"
# Number of algorithms to be plotted
num_algs = 2
#
if len(argv) != 2:
	print "Use ./stat.py [query | del | ins] to generate graphs"
	exit()
	
reading = argv[1]
plural = ""
if reading == "query":
	plural = "queries"
elif reading == "del":
	plural = "deletions"
elif reading == "ins":
	plural = "insertions"
else:
	print "Unknown reading. Must be either 'query', 'del' or 'ins'"
	exit()

suffix = "-{:s}.stat".format(reading)

# Get a dict of all test cases<commit_msg>Forcing to use backend TGAgg<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
	This software is implemented as part of the course Dynamic Algorithms 
	(Q4 2015) at Aarhus Univerity Denmark. 

	stat.py
	Used to create plots of execution times.
	
	Stronly inspired by http://stackoverflow.com/a/16598291/4620080

	Author: <NAME> and <NAME>
"""
from pylab import plot, show, savefig, xlim, figure, \
                hold, ylim, legend, boxplot, setp, axes, \
                title, ylabel, xlabel, subplots_adjust, suptitle, switch_backend

from utils import get_test_cases, get_test_case
from sys import argv
import numpy as np
switch_backend('TKAgg')
# Built-in colors: Blue, Green, Red,
# Cyan, Magenta, Yellow and Black
colors = "bgrcmyk"
# Number of algorithms to be plotted
num_algs = 2
#
if len(argv) != 2:
	print "Use ./stat.py [query | del | ins] to generate graphs"
	exit()
	
reading = argv[1]
plural = ""
if reading == "query":
	plural = "queries"
elif reading == "del":
	plural = "deletions"
elif reading == "ins":
	plural = "insertions"
else:
	print "Unknown reading. Must be either 'query', 'del' or 'ins'"
	exit()

suffix = "-{:s}.stat".format(reading)

# Get a dict of all test cases
{'fraction_non_alphanumeric': 0.12431056427662282, 'fraction_numerical': 0.020364870598218072, 'mean_word_length': 3.6693069306930695, 'pattern_counts': {'":': 6, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4052187', 'n_tokens_mistral': 858, 'n_tokens_neox': 792, 'n_words': 285}