@@ -21,13 +21,15 @@ def create_in_vivo_concentrations_figure():
21
21
concentration = "VIVOCONC"
22
22
output_path = "./cosa/in_vivo_concentrations_figure.png"
23
23
table_path = f"cosa/results_aerobic/optsubmdf_table_{ concentration } .csv"
24
- pad = 4.99
24
+ pad = 0.98
25
25
26
26
target = "OPTSUBMDF"
27
27
28
28
figurename_tuple = ("aerobic" , f"2C_NADH_to_NAD___to___NADPH_to_nadp_{ target } _{ concentration } .jpg" )
29
29
30
- fig , axs = plt .subplots (nrows = 1 , ncols = 2 , dpi = 500 , figsize = (18 , 6 )) #sharex=True, figsize=(50, 25), dpi=120, facecolor="white")
30
+ cm = 1 / 2.54
31
+ # fig, axs = plt.subplots(nrows=1, ncols=2, dpi=500, figsize=(18, 6)) #sharex=True, figsize=(50, 25), dpi=120, facecolor="white")
32
+ fig , axs = plt .subplots (nrows = 1 , ncols = 2 , dpi = 500 , figsize = (18 * cm , 6 * cm )) #sharex=True, figsize=(50, 25), dpi=120, facecolor="white")
31
33
fig .tight_layout (pad = pad )
32
34
33
35
########################################################
@@ -62,17 +64,17 @@ def create_in_vivo_concentrations_figure():
62
64
label = "Flexible specificity"
63
65
linestyle = "--"
64
66
color = "yellowgreen"
65
- linewidth = 2.0
67
+ linewidth = 1.1
66
68
elif header == in_vivo_id :
67
69
label = "Wild-type specificity"
68
70
linestyle = "-"
69
71
color = "black"
70
- linewidth = 2.0
72
+ linewidth = 1.1
71
73
elif header == only_one_id :
72
74
label = "Single cofactor pool"
73
75
linestyle = "-"
74
76
color = "red"
75
- linewidth = 2.0
77
+ linewidth = 1.1
76
78
else :
77
79
if is_first_random :
78
80
label = "Random specificities"
@@ -81,7 +83,7 @@ def create_in_vivo_concentrations_figure():
81
83
label = ""
82
84
linestyle = "-"
83
85
color = "paleturquoise"
84
- linewidth = 1.0
86
+ linewidth = 0.6
85
87
86
88
axs [0 ].plot (
87
89
growth_rates [:- 1 ], # x
@@ -91,12 +93,12 @@ def create_in_vivo_concentrations_figure():
91
93
color = color ,
92
94
linewidth = linewidth ,
93
95
)
94
- axs [0 ].legend (loc = "lower left" , fontsize = 16 )
95
- axs [0 ].set_title ("a" , loc = "left" , fontweight = "bold" , fontsize = 18 )
96
- axs [0 ].set_xlabel ("Growth rate [1/h]" , fontsize = 14 )
97
- axs [0 ].set_ylabel ("SubMDF [kJ/mol]" , fontsize = 14 )
96
+ axs [0 ].legend (loc = "lower left" , fontsize = 7 )
97
+ axs [0 ].set_title ("a" , loc = "left" , fontweight = "bold" , fontsize = 7 )
98
+ axs [0 ].set_xlabel ("Growth rate [1/h]" , fontsize = 7 )
99
+ axs [0 ].set_ylabel ("SubMDF [kJ/mol]" , fontsize = 7 )
98
100
axs [0 ].set_xlim (min (growth_rates [:- 1 ]), max (growth_rates [:- 1 ]))
99
- axs [0 ].tick_params (labelsize = 14 )
101
+ axs [0 ].tick_params (axis = "both" , labelsize = 6 )
100
102
101
103
102
104
########################################################
@@ -118,20 +120,22 @@ def create_in_vivo_concentrations_figure():
118
120
"bo" ,
119
121
label = min_label ,
120
122
linewidth = 1.0 ,
123
+ markersize = 2.75 ,
121
124
)
122
125
axs [1 ].plot (
123
126
plotted_growth_rates [::- 1 ], # x
124
127
max_ratios [::- 1 ], # y
125
128
"ro" ,
126
129
label = max_label ,
127
130
linewidth = 1.0 ,
131
+ markersize = 2.75 ,
128
132
)
129
- axs [1 ].legend (loc = "upper center" , ncol = 2 , fontsize = 16 )
130
- axs [1 ].set_title ("b" , loc = "left" , fontweight = "bold" , fontsize = 18 )
131
- axs [1 ].set_xlabel ("Growth rate [1/h]" , fontsize = 15 )
133
+ axs [1 ].legend (loc = "upper center" , ncol = 2 , fontsize = 7 )
134
+ axs [1 ].set_title ("b" , loc = "left" , fontweight = "bold" , fontsize = 7 )
135
+ axs [1 ].set_xlabel ("Growth rate [1/h]" , fontsize = 7 )
132
136
# axs[1].set_ylabel(r"$\mathrm{\frac{[NADH]/[NAD^{+}]}{[NADPH]/[NADP^{+}]}}$", fontsize=15)
133
- axs [1 ].set_ylabel (r"$\mathrm{[NADH]/[NAD^{+}] \ / \ [NADPH]/[NADP^{+}]}$" , fontsize = 14 )
134
- axs [1 ].tick_params (labelsize = 14 )
137
+ axs [1 ].set_ylabel (r"$\mathrm{[NADH]/[NAD^{+}] \ / \ [NADPH]/[NADP^{+}]}$" , fontsize = 7 )
138
+ axs [1 ].tick_params (labelsize = 6 )
135
139
136
140
axs [1 ].set_ylim (- .00003 , 0.0006 )
137
141
axs [1 ].set_xlim (0.025 , 0.89 )
@@ -150,9 +154,11 @@ def create_acetate_figure():
150
154
ratio_ratio_test_data_aerobic = json_load ("cosa/results_aerobic_acetate/ratio_ratio_test_data.json" )
151
155
concentration = "STANDARDCONC"
152
156
output_path = "./cosa/acetate_figure.png"
153
- pad = 5.25
157
+ pad = 1.7
154
158
155
- fig , axs = plt .subplots (nrows = 2 , ncols = 2 , dpi = 500 , figsize = (14 , 11 )) #sharex=True, figsize=(50, 25), dpi=120, facecolor="white")
159
+ cm = 1 / 2.54
160
+ fig , axs = plt .subplots (nrows = 2 , ncols = 2 , dpi = 500 , figsize = (18 * cm , 14.14 * cm )) #sharex=True, figsize=(50, 25), dpi=120, facecolor="white")
161
+ # fig, axs = plt.subplots(nrows=2, ncols=2, dpi=500, figsize=(14, 11)) #sharex=True, figsize=(50, 25), dpi=120, facecolor="white")
156
162
fig .tight_layout (pad = pad )
157
163
158
164
for target in ("OPTSUBMDF" , "OPTMDF" ):
@@ -195,17 +201,17 @@ def create_acetate_figure():
195
201
label = "Flexible specificity"
196
202
linestyle = "--"
197
203
color = "yellowgreen"
198
- linewidth = 2 .0
204
+ linewidth = 1 .0
199
205
elif header == in_vivo_id :
200
206
label = "Wild-type specificity"
201
207
linestyle = "-"
202
208
color = "black"
203
- linewidth = 2 .0
209
+ linewidth = 1 .0
204
210
elif header == only_one_id :
205
211
label = "Single cofactor pool"
206
212
linestyle = "-"
207
213
color = "red"
208
- linewidth = 2 .0
214
+ linewidth = 1 .0
209
215
else :
210
216
if is_first_random :
211
217
label = "Random specificities"
@@ -214,7 +220,7 @@ def create_acetate_figure():
214
220
label = ""
215
221
linestyle = "-"
216
222
color = "paleturquoise"
217
- linewidth = 1.0
223
+ linewidth = .6
218
224
219
225
axs [xpos , 0 ].plot (
220
226
growth_rates [:- 1 ], # x
@@ -224,12 +230,12 @@ def create_acetate_figure():
224
230
color = color ,
225
231
linewidth = linewidth ,
226
232
)
227
- axs [xpos , 0 ].legend (loc = "lower left" , fontsize = 14 )
228
- axs [xpos , 0 ].set_title ("c Sampling with SubMDF" if "SUB" in target else "a Sampling with MDF" , loc = "left" , fontweight = "bold" , fontsize = 18 )
229
- axs [xpos , 0 ].set_xlabel ("Growth rate [1/h]" , fontsize = 14 )
230
- axs [xpos , 0 ].set_ylabel (f"{ target .replace ('OPT' , '' ).replace ('SUB' , 'Sub' )} [kJ/mol]" , fontsize = 14 )
233
+ axs [xpos , 0 ].legend (loc = "lower left" , fontsize = 7 )
234
+ axs [xpos , 0 ].set_title ("c Sampling with SubMDF" if "SUB" in target else "a Sampling with MDF" , loc = "left" , fontweight = "bold" , fontsize = 7 )
235
+ axs [xpos , 0 ].set_xlabel ("Growth rate [1/h]" , fontsize = 7 )
236
+ axs [xpos , 0 ].set_ylabel (f"{ target .replace ('OPT' , '' ).replace ('SUB' , 'Sub' )} [kJ/mol]" , fontsize = 7 )
231
237
axs [xpos , 0 ].set_xlim (min (growth_rates [:- 1 ]), max (growth_rates [:- 1 ]))
232
- axs [xpos , 0 ].tick_params (labelsize = 14 )
238
+ axs [xpos , 0 ].tick_params (axis = "both" , labelsize = 7 )
233
239
234
240
235
241
########################################################
@@ -251,21 +257,24 @@ def create_acetate_figure():
251
257
"bo" ,
252
258
label = min_label ,
253
259
linewidth = 1.0 ,
260
+ markersize = 3 ,
254
261
)
255
262
axs [xpos , 1 ].plot (
256
263
plotted_growth_rates [::- 1 ], # x
257
264
max_ratios [::- 1 ], # y
258
265
"ro" ,
259
266
label = max_label ,
260
267
linewidth = 1.0 ,
268
+ markersize = 3 ,
261
269
)
262
- axs [xpos , 1 ].legend (loc = "upper center" , ncol = 2 , fontsize = 15 )
263
- axs [xpos , 1 ].set_title ("d Ratios with SubMDF" if "SUB" in target else "b Ratios with MDF" , loc = "left" , fontweight = "bold" , fontsize = 18 )
264
- axs [xpos , 1 ].set_xlabel ("Growth rate [1/h]" , fontsize = 15 )
265
- axs [xpos , 1 ].set_ylabel (r"$\mathrm{[NADH]/[NAD^{+}] \ / \ [NADPH]/[NADP^{+}]}$" , fontsize = 13 )
266
- axs [xpos , 1 ].tick_params (labelsize = 14 )
270
+ axs [xpos , 1 ].legend (loc = "upper center" , ncol = 2 , fontsize = 7 )
271
+ axs [xpos , 1 ].set_title ("d Ratios with SubMDF" if "SUB" in target else "b Ratios with MDF" , loc = "left" , fontweight = "bold" , fontsize = 7 )
272
+ axs [xpos , 1 ].set_xlabel ("Growth rate [1/h]" , fontsize = 7 )
273
+ axs [xpos , 1 ].set_ylabel (r"$\mathrm{[NADH]/[NAD^{+}] \ / \ [NADPH]/[NADP^{+}]}$" , fontsize = 7 )
274
+ axs [xpos , 1 ].tick_params (labelsize = 7 )
267
275
axs [xpos , 1 ].set_ylim (- .0001 if "SUB" in target else - 0.005 , 0.0015 if "SUB" in target else 0.09 )
268
276
axs [xpos , 1 ].set_xlim (0.045 , 0.21 )
277
+ axs [xpos , 1 ].tick_params (axis = "both" , labelsize = 7 )
269
278
pad_inches = 0.05
270
279
271
280
# fig.subplots_adjust(right=1.1)
0 commit comments