Skip to content

Commit 4286dc4

Browse files
committed
small bug fix and moved colorbar to right slightly
1 parent caff6e5 commit 4286dc4

16 files changed

+12
-6
lines changed

Diff for: example/chord/ex0_chord.png

-4.32 KB
Loading

Diff for: example/chord/ex1_black_BG_chord.png

-1.1 KB
Loading

Diff for: example/chord/ex1_chord.png

-240 Bytes
Loading

Diff for: example/chord/ex1_count_chord.png

-1.52 KB
Loading

Diff for: example/chord/ex2_chord.png

-1.18 KB
Loading

Diff for: example/ex0.png

69.3 KB
Loading

Diff for: example/ex1.png

168 KB
Loading

Diff for: example/ex1_black_BG.png

184 KB
Loading

Diff for: example/ex1_count.png

72.7 KB
Loading

Diff for: example/ex2.png

71 KB
Loading

Diff for: example/glass/ex0_glass.png

-20 Bytes
Loading

Diff for: example/glass/ex1_black_BG_glass.png

5.82 KB
Loading

Diff for: example/glass/ex1_count_glass.png

6.44 KB
Loading

Diff for: example/glass/ex1_glass.png

5.82 KB
Loading

Diff for: example/glass/ex2_glass.png

5.07 KB
Loading

Diff for: nichord/chord.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,8 @@ def plot_chord(idx_to_label: dict,
211211
cbar = plt.colorbar(
212212
mappable=matplotlib.cm.ScalarMappable(cmap=cmap,
213213
norm=matplotlib.colors.Normalize(
214-
vmin=vmin,
215-
vmax=vmax)),
216-
fraction=0.04, pad=0.02, ax=plt.gca())
214+
vmin=vmin, vmax=vmax)),
215+
fraction=0.04, pad=0.04, ax=plt.gca())
217216
cbar.ax.tick_params(labelsize=30)
218217

219218
plt.axis('off')
@@ -260,18 +259,25 @@ def plot_rim_and_labels(idx_to_label: dict, network_order: list,
260259
cnt = network_counts[network]
261260
degree_st = circle_consumed / num_ROIs * 360
262261
degree_end = (circle_consumed + cnt) / num_ROIs * 360
263-
plot_rim(degree_st, degree_end, rim_border=rim_border, radius=radius,
262+
if degree_end - degree_st < rim_border:
263+
warnings.warn(f'There are very few ROIs for the {network} network. '
264+
f'May produce weirdness')
265+
rim_border_ = 0
266+
else:
267+
rim_border_ = rim_border
268+
plot_rim(degree_st, degree_end, rim_border=rim_border_, radius=radius,
264269
color=network_colors[network])
265-
plot_rim_label(degree_st, degree_end, network, rim_border=rim_border,
270+
plot_rim_label(degree_st, degree_end, network, rim_border=rim_border_,
266271
radius=radius,
267272
color=network_colors[network],
268273
label_fontsize=label_fontsize,
269274
do_monkeypatch=do_monkeypatch)
270275
network_low_high[network] = (
271-
degree_st + rim_border, degree_end - rim_border)
276+
degree_st + rim_border_, degree_end - rim_border_)
272277
network_center[network] = (circle_consumed + cnt * 0.5) / num_ROIs * 360
273278
network_starts_ends[network] = (degree_st, degree_end)
274279
circle_consumed += cnt
280+
275281
if black_BG:
276282
ax = plt.gca()
277283
black_circle = plt.Circle((0, 0), radius=radius - .0225, color='k')

0 commit comments

Comments
 (0)