1 import plotly.graph_objs
as go
2 import plotly.express
as px
5 line_types = [
'solid',
'dot',
'dash',
'dashdot',
'dashdot',
'longdashdot']
6 colors = [
'DarkSlateGrey',
'DarkSeaGreen',
'DarkViolet',
'red']
7 def lines(data,name,x_lims,y_lims):
10 for key,value
in data.items():
11 fig.add_trace(go.Scatter(
14 line =
dict(width=3, dash=line_types[i],color =colors[i] )
40 family =
'Times New Roman',
55 family =
'Times New Roman',
65 paper_bgcolor=
'rgba(0,0,0,0)',
66 plot_bgcolor=
'rgba(0,0,0,0)',
72 family=
'Times New Roman',
76 bordercolor=
'DarkSeaGreen'
88 fig.update_yaxes(automargin=
True,showgrid=
False,zeroline=
False)
89 fig.update_xaxes(automargin=
True,showgrid=
False,zeroline=
False)
90 fig.write_image(name+
'.svg')
93 def extract_data(postfix):
94 data = pd.read_csv(
'cell_count_{}.csv'.format(postfix))
96 if "Unnamed: 0" in data.keys():
97 data = data.drop(
"Unnamed: 0", axis=1)
99 data = map(
lambda postfix: extract_data(postfix),postfixes)
101 data = pd.concat(data, axis=1)
105 data.columns = postfixes
106 lines(data,plot_name,x_lims= x_lims,y_lims=y_lims)
109 if __name__ ==
'__main__':
110 postfixes = [
'Cpp',
'Py',
'Cppy',
'Pyy']
112 postfixes = [
'Cpp',
'Py']