Box and stuff
This commit is contained in:
@ -60,52 +60,6 @@ def plot_histogram(bars_dict_list: List[dict], filename='histogram_plot'):
|
||||
pass
|
||||
|
||||
|
||||
def line_plot(line_dict_list, filename='lineplot'):
|
||||
# lines with standard deviation
|
||||
# Transform data accordingly and plot it
|
||||
data = []
|
||||
rdylgn = cl.scales['10']['div']['RdYlGn']
|
||||
rdylgn_background = [scale + (0.4,) for scale in cl.to_numeric(rdylgn)]
|
||||
for line_id, line_dict in enumerate(line_dict_list):
|
||||
name = line_dict.get('name', 'gimme a name')
|
||||
|
||||
upper_bound = go.Scatter(
|
||||
name='Upper Bound',
|
||||
x=line_dict['x'],
|
||||
y=line_dict['upper_y'],
|
||||
mode='lines',
|
||||
marker=dict(color="#444"),
|
||||
line=dict(width=0),
|
||||
fillcolor=rdylgn_background[line_id],
|
||||
)
|
||||
|
||||
trace = go.Scatter(
|
||||
x=line_dict['x'],
|
||||
y=line_dict['main_y'],
|
||||
mode='lines',
|
||||
name=name,
|
||||
line=dict(color=line_id),
|
||||
fillcolor=rdylgn_background[line_id],
|
||||
fill='tonexty')
|
||||
|
||||
lower_bound = go.Scatter(
|
||||
name='Lower Bound',
|
||||
x=line_dict['x'],
|
||||
y=line_dict['lower_y'],
|
||||
marker=dict(color="#444"),
|
||||
line=dict(width=0),
|
||||
mode='lines')
|
||||
|
||||
data.extend([upper_bound, trace, lower_bound])
|
||||
|
||||
layout=dict(title='{} Line Plot'.format('Experiment Name Penis'),
|
||||
height=800, width=800, margin=dict(l=0, r=0, t=0, b=0))
|
||||
|
||||
fig = go.Figure(data=data, layout=layout)
|
||||
pl.offline.plot(fig, auto_open=True, filename=filename)
|
||||
pass
|
||||
|
||||
|
||||
def search_and_apply(absolut_file_or_folder, plotting_function, files_to_look_for=[]):
|
||||
if os.path.isdir(absolut_file_or_folder):
|
||||
for sub_file_or_folder in os.scandir(absolut_file_or_folder):
|
||||
|
Reference in New Issue
Block a user