Skip to content

Commit a5be06f

Browse files
authored
Merge pull request #5 from anthony-wang/plotting-updates
Small visual improvements in plotting
2 parents 7436ccd + 2edf703 commit a5be06f

11 files changed

+18
-5
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ models/trained_rf/*.joblib
33
models/trained_models/*.pth
44
models/*.zip
55
models/*.7z
6+
7+
68
# figures/lc_data/*.png
9+
figures/*.eps
710
*.npz
811

912
# Pylint code analysis stuff

Paper_FIG_2.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,12 @@ def get_attention(attn_mat, idx=0, layer=0, head=0):
170170
other_dict = {i: [] for i in range(1, 119)}
171171

172172
option = [0, 1, 2, 3, 'average']
173-
head_option = option[0]
173+
option_texts = ['a)', 'b)', 'c)', 'd)', 'average']
174+
175+
idx_plot = 0
176+
head_option = option[idx_plot]
177+
option_text = option_texts[idx_plot]
178+
174179
for idx in range(len(data_loader.dataset)):
175180
map_data = get_attention(attn_mat, idx=idx, layer=layer, head=head_option)
176181
atom_fracs = get_atomic_fracs(data_loader, idx=idx)
@@ -244,16 +249,17 @@ def plot(mat_prop, property_tracker):
244249
color = 'silver'
245250
if row < 3:
246251
row += 0.5
252+
# element box
247253
rect = patches.Rectangle((column, row), rw, rh,
248254
linewidth=1.5,
249255
edgecolor='gray',
250256
facecolor=color,
251257
alpha=1)
252-
258+
# plot element text
253259
text = plt.text(column+rw/2, row+rw/2, symbol,
254260
horizontalalignment='center',
255261
verticalalignment='center',
256-
fontsize=16,
262+
fontsize=22,
257263
fontweight='semibold', color='white')
258264

259265
text.set_path_effects([path_effects.Stroke(linewidth=3,
@@ -300,6 +306,9 @@ def plot(mat_prop, property_tracker):
300306
verticalalignment='center',
301307
fontweight='semibold',
302308
fontsize=20, color='k')
309+
# add annotation for subfigure numbering
310+
plt.text(0.55, n_row+.1, option_text,
311+
fontweight='semibold', fontsize=38, color='k')
303312
ax.set_ylim(-0.15, n_row+.1)
304313
ax.set_xlim(0.85, n_column+1.1)
305314

Paper_FIG_3.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -194,16 +194,17 @@ def plot(mat_prop, property_tracker):
194194
color = 'silver'
195195
if row < 3:
196196
row += 0.5
197+
# element box
197198
rect = patches.Rectangle((column, row), rw, rh,
198199
linewidth=1.5,
199200
edgecolor='gray',
200201
facecolor=color,
201202
alpha=1)
202-
203+
# plot element text
203204
plt.text(column+rw/2, row+rw/2, symbol,
204205
horizontalalignment='center',
205206
verticalalignment='center',
206-
fontsize=20,
207+
fontsize=22,
207208
fontweight='semibold', color='k')
208209

209210
ax.add_patch(rect)

figures/Figure2.png

-982 KB
Loading
156 KB
Loading
154 KB
Loading
154 KB
Loading
156 KB
Loading
166 KB
Loading

figures/Figure3.png

4.5 KB
Loading

figures/binary_plot_Si-O.png

-232 KB
Binary file not shown.

0 commit comments

Comments
 (0)