2019-12-14 17:50:27 +00:00
|
|
|
import matplotlib.pyplot as plt
|
|
|
|
import matplotlib.patches as mpatches
|
|
|
|
import numpy as numpy
|
|
|
|
import pandas as pd
|
|
|
|
|
|
|
|
def getcolor(n):
|
2019-12-15 09:58:32 +00:00
|
|
|
return ['#aa0000', '#00aa00', '#0000aa', '#aaaa00', '#aa00aa'][int((i - 12) / 2)]
|
2019-12-14 17:50:27 +00:00
|
|
|
|
|
|
|
df = pd.read_csv('pretty.csv', delimiter='\s', engine='python')
|
|
|
|
|
|
|
|
x = df['k'].unique()
|
|
|
|
|
|
|
|
for i in df['i_min'].unique():
|
|
|
|
rows = df.loc[df['i_min'] == i]
|
|
|
|
plt.errorbar(
|
|
|
|
x,
|
|
|
|
rows['mean'],
|
|
|
|
yerr=rows['ci'],
|
|
|
|
marker='.',
|
|
|
|
capsize=4,
|
|
|
|
ms=3,
|
|
|
|
mec='r',
|
|
|
|
mfc='r',
|
|
|
|
linestyle='-',
|
|
|
|
linewidth=1,
|
|
|
|
color=getcolor(i),
|
|
|
|
ecolor='red'
|
|
|
|
)
|
|
|
|
|
|
|
|
handles = []
|
|
|
|
for i in df['i_min'].unique():
|
|
|
|
handles.append(mpatches.Patch(color=getcolor(i), label='Imin = ' + str(i)))
|
|
|
|
|
|
|
|
plt.legend(handles=handles)
|
|
|
|
|
|
|
|
plt.show()
|
|
|
|
|