import matplotlib as mpl
mpl.use('Agg')
from fractions import Fraction
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import FixedLocator
import platform
import sys
import math
import statistics
try:
import cPickle as pickle
except ImportError: # Python 3.x
import pickle
test_names = []
method_names = []
colors = ["#F78154", "#1C3144", "#2274A5", "#32936F",
"#D00000", "#FFBF00", "#8D2AB7", "#27182E", "#232534"]
# the ones that we actually care about, in this case we care about distribution between 0 to 3
bin_size_comp = 30
actual_bin_size_comp = 50 # position 40 and 50 are for outliers and negative intervals
bins_comp = [x/10.0 for x in list(range(0, actual_bin_size_comp+1, 1))]
# < -16, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, >=3, placeholder, empty
bin_size_raw = 22 # the ones that we actually care about, in this case we care about distribution between 10^-17 to 10^3
actual_bin_size_raw = 23 # position 50 for outliers, position 60 for negatives
bins_raw = list(range(-17, 6, 1))
def plot_raw(datas, test_name, system = "mac"):
plt.rc('xtick', labelsize=7) # fontsize of the tick labels
plt.rc('ytick', labelsize=10) # fontsize of the tick labels
plt.rc('legend', fontsize=10) # fontsize of the tick labels
bar_width = 0.5/(len(datas))
all_items = []
for item in datas:
all_items += datas[item]
average = statistics.median(all_items)
if average