Skip to content

Commit 20ca15d

Browse files
committed
Resize figures
1 parent 6d90a90 commit 20ca15d

18 files changed

+97
-75
lines changed

cosa/Figure3.pdf

2.14 KB
Binary file not shown.

cosa/Figure4.pdf

389 Bytes
Binary file not shown.

cosa/Figure5.pdf

176 Bytes
Binary file not shown.

cosa/Figure6.pdf

323 Bytes
Binary file not shown.

cosa/FigureS1.pdf

-6 Bytes
Binary file not shown.

cosa/FigureS1.png

-326 KB
Loading

cosa/FigureS2.pdf

-164 Bytes
Binary file not shown.

cosa/FigureS2.png

-577 KB
Loading

cosa/acetate_figure.png

-1.09 MB
Loading
-136 KB
Loading
Loading
Loading
-577 KB
Loading
Loading

cosa_create_extended_model_figure.py

+12-9
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ def _get_data_list(file_path: str):
2424

2525
# LOGIC #
2626
for concentration_ranges in ("STANDARDCONC",): #"VIVOCONC"):
27-
fig, axs = plt.subplots(nrows=1, ncols=2, dpi=500, figsize=(11, 4)) #sharex=True, figsize=(50, 25), dpi=120, facecolor="white")
27+
cm = 1/2.54
28+
fig, axs = plt.subplots(nrows=1, ncols=2, dpi=500, figsize=(18*cm, 6.55*cm)) #sharex=True, figsize=(50, 25), dpi=120, facecolor="white")
29+
# fig, axs = plt.subplots(nrows=1, ncols=2, dpi=500, figsize=(11, 4)) #sharex=True, figsize=(50, 25), dpi=120, facecolor="white")
2830

2931
for run in (0, 1, 2):
3032
for aerobicity in ("aerobic", "anaerobic"):
@@ -76,7 +78,7 @@ def _get_data_list(file_path: str):
7678
label=label_optmdf_two,
7779
linestyle="-",
7880
color="salmon",
79-
linewidth=2.0,
81+
linewidth=1.0,
8082
)
8183
if run == 0:
8284
axs[axs_row].plot(
@@ -85,7 +87,7 @@ def _get_data_list(file_path: str):
8587
label=label_optmdf_three,
8688
linestyle=linestyle,
8789
color="red",
88-
linewidth=2.0,
90+
linewidth=1.0,
8991
)
9092
if run == 1:
9193
if change_state == 0:
@@ -95,29 +97,30 @@ def _get_data_list(file_path: str):
9597
label=label_optsubmdf_two,
9698
linestyle="-",
9799
color="deepskyblue",
98-
linewidth=2.0,
100+
linewidth=1.0,
99101
)
100102
axs[axs_row].plot(
101103
growth_rates, # x
102104
data_optsubmdf_expanded, # y
103105
label=label_optsubmdf_three,
104106
linestyle=linestyle,
105107
color="blue",
106-
linewidth=2.0,
108+
linewidth=1.0,
107109
)
108110

109111
anaerobic = aerobicity == "anaerobic"
110-
axs[axs_row].set_title(title, loc="left", fontweight="bold")
111-
axs[axs_row].set_xlabel("Growth rate [1/h]")
112-
axs[axs_row].set_ylabel(r"(Sub)MDF [kJ/mol]")
112+
axs[axs_row].set_title(title, loc="left", fontweight="bold", fontsize=7)
113+
axs[axs_row].set_xlabel("Growth rate [1/h]", fontsize=7)
114+
axs[axs_row].set_ylabel(r"(Sub)MDF [kJ/mol]", fontsize=7)
113115
axs[axs_row].set_xlim(min(growth_rates), max(growth_rates))
116+
axs[axs_row].tick_params(axis='both', labelsize=7)
114117

115118
if axs_row == 0:
116119
axs[axs_row].set_ylim(0.0, 50)
117120
else:
118121
axs[axs_row].set_ylim(0.0, 40)
119122

120-
fig.legend(loc="upper center", bbox_to_anchor=(0.5, 1.18), ncol=2)
123+
fig.legend(loc="upper center", bbox_to_anchor=(0.5, 1.18), ncol=2, fontsize=6.25)
121124
fig.savefig(f"cosa/expanded_comparison_{concentration_ranges}.png", bbox_inches='tight', pad_inches=0.0)
122125
fig.savefig(f"cosa/Figure5.pdf", bbox_inches='tight', pad_inches=0.0)
123126
plt.close()

cosa_create_special_aerobic_figures.py

+41-32
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ def create_in_vivo_concentrations_figure():
2121
concentration = "VIVOCONC"
2222
output_path = "./cosa/in_vivo_concentrations_figure.png"
2323
table_path = f"cosa/results_aerobic/optsubmdf_table_{concentration}.csv"
24-
pad = 4.99
24+
pad = 0.98
2525

2626
target = "OPTSUBMDF"
2727

2828
figurename_tuple = ("aerobic", f"2C_NADH_to_NAD___to___NADPH_to_nadp_{target}_{concentration}.jpg")
2929

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")
3133
fig.tight_layout(pad=pad)
3234

3335
########################################################
@@ -62,17 +64,17 @@ def create_in_vivo_concentrations_figure():
6264
label = "Flexible specificity"
6365
linestyle = "--"
6466
color = "yellowgreen"
65-
linewidth = 2.0
67+
linewidth = 1.1
6668
elif header == in_vivo_id:
6769
label = "Wild-type specificity"
6870
linestyle = "-"
6971
color = "black"
70-
linewidth = 2.0
72+
linewidth = 1.1
7173
elif header == only_one_id:
7274
label = "Single cofactor pool"
7375
linestyle = "-"
7476
color = "red"
75-
linewidth = 2.0
77+
linewidth = 1.1
7678
else:
7779
if is_first_random:
7880
label = "Random specificities"
@@ -81,7 +83,7 @@ def create_in_vivo_concentrations_figure():
8183
label = ""
8284
linestyle = "-"
8385
color = "paleturquoise"
84-
linewidth = 1.0
86+
linewidth = 0.6
8587

8688
axs[0].plot(
8789
growth_rates[:-1], # x
@@ -91,12 +93,12 @@ def create_in_vivo_concentrations_figure():
9193
color=color,
9294
linewidth=linewidth,
9395
)
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)
98100
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)
100102

101103

102104
########################################################
@@ -118,20 +120,22 @@ def create_in_vivo_concentrations_figure():
118120
"bo",
119121
label=min_label,
120122
linewidth=1.0,
123+
markersize=2.75,
121124
)
122125
axs[1].plot(
123126
plotted_growth_rates[::-1], # x
124127
max_ratios[::-1], # y
125128
"ro",
126129
label=max_label,
127130
linewidth=1.0,
131+
markersize=2.75,
128132
)
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)
132136
# 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)
135139

136140
axs[1].set_ylim(-.00003, 0.0006)
137141
axs[1].set_xlim(0.025, 0.89)
@@ -150,9 +154,11 @@ def create_acetate_figure():
150154
ratio_ratio_test_data_aerobic = json_load("cosa/results_aerobic_acetate/ratio_ratio_test_data.json")
151155
concentration = "STANDARDCONC"
152156
output_path = "./cosa/acetate_figure.png"
153-
pad = 5.25
157+
pad = 1.7
154158

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")
156162
fig.tight_layout(pad=pad)
157163

158164
for target in ("OPTSUBMDF", "OPTMDF"):
@@ -195,17 +201,17 @@ def create_acetate_figure():
195201
label = "Flexible specificity"
196202
linestyle = "--"
197203
color = "yellowgreen"
198-
linewidth = 2.0
204+
linewidth = 1.0
199205
elif header == in_vivo_id:
200206
label = "Wild-type specificity"
201207
linestyle = "-"
202208
color = "black"
203-
linewidth = 2.0
209+
linewidth = 1.0
204210
elif header == only_one_id:
205211
label = "Single cofactor pool"
206212
linestyle = "-"
207213
color = "red"
208-
linewidth = 2.0
214+
linewidth = 1.0
209215
else:
210216
if is_first_random:
211217
label = "Random specificities"
@@ -214,7 +220,7 @@ def create_acetate_figure():
214220
label = ""
215221
linestyle = "-"
216222
color = "paleturquoise"
217-
linewidth = 1.0
223+
linewidth = .6
218224

219225
axs[xpos, 0].plot(
220226
growth_rates[:-1], # x
@@ -224,12 +230,12 @@ def create_acetate_figure():
224230
color=color,
225231
linewidth=linewidth,
226232
)
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)
231237
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)
233239

234240

235241
########################################################
@@ -251,21 +257,24 @@ def create_acetate_figure():
251257
"bo",
252258
label=min_label,
253259
linewidth=1.0,
260+
markersize=3,
254261
)
255262
axs[xpos, 1].plot(
256263
plotted_growth_rates[::-1], # x
257264
max_ratios[::-1], # y
258265
"ro",
259266
label=max_label,
260267
linewidth=1.0,
268+
markersize=3,
261269
)
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)
267275
axs[xpos, 1].set_ylim(-.0001 if "SUB" in target else -0.005, 0.0015 if "SUB" in target else 0.09)
268276
axs[xpos, 1].set_xlim(0.045, 0.21)
277+
axs[xpos, 1].tick_params(axis="both", labelsize=7)
269278
pad_inches = 0.05
270279

271280
# fig.subplots_adjust(right=1.1)

0 commit comments

Comments
 (0)