Skip to content

Commit 4db6968

Browse files
committed
FIX: Replace deprecated Matplotlib functionality
1 parent c86c328 commit 4db6968

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

niworkflows/viz/plots.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -838,9 +838,9 @@ def compcor_variance_plot(
838838

839839
ax[m].set_yticks([])
840840
ax[m].set_yticklabels([])
841-
for tick in ax[m].xaxis.get_major_ticks():
842-
tick.label.set_fontsize("x-small")
843-
tick.label.set_rotation("vertical")
841+
for label in ax[m].xaxis.get_majorticklabels():
842+
label.set_fontsize("x-small")
843+
label.set_rotation("vertical")
844844
for side in ["top", "right", "left"]:
845845
ax[m].spines[side].set_color("none")
846846
ax[m].spines[side].set_visible(False)
@@ -934,10 +934,10 @@ def confounds_correlation_plot(
934934
sns.heatmap(corr, linewidths=0.5, cmap="coolwarm", center=0, square=True, ax=ax0)
935935
ax0.tick_params(axis="both", which="both", width=0)
936936

937-
for tick in ax0.xaxis.get_major_ticks():
938-
tick.label.set_fontsize("small")
939-
for tick in ax0.yaxis.get_major_ticks():
940-
tick.label.set_fontsize("small")
937+
for label in ax0.xaxis.get_majorticklabels():
938+
label.set_fontsize("small")
939+
for label in ax0.yaxis.get_majorticklabels():
940+
label.set_fontsize("small")
941941
sns.barplot(
942942
data=gscorr,
943943
x="index",
@@ -953,11 +953,11 @@ def confounds_correlation_plot(
953953
ax1.tick_params(axis="x", which="both", width=0)
954954
ax1.tick_params(axis="y", which="both", width=5, length=5)
955955

956-
for tick in ax1.xaxis.get_major_ticks():
957-
tick.label.set_fontsize("small")
958-
tick.label.set_rotation("vertical")
959-
for tick in ax1.yaxis.get_major_ticks():
960-
tick.label.set_fontsize("small")
956+
for label in ax1.xaxis.get_majorticklabels():
957+
label.set_fontsize("small")
958+
label.set_rotation("vertical")
959+
for label in ax1.yaxis.get_majorticklabels():
960+
label.set_fontsize("small")
961961
for side in ["top", "right", "left"]:
962962
ax1.spines[side].set_color("none")
963963
ax1.spines[side].set_visible(False)

niworkflows/viz/utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -698,9 +698,9 @@ def plot_melodic_components(
698698
ax2.autoscale_view("tight")
699699
ax2.tick_params(axis="both", which="major", pad=0)
700700
sns.despine(left=True, bottom=True)
701-
for tick in ax2.xaxis.get_major_ticks():
702-
tick.label.set_fontsize(6)
703-
tick.label.set_color(color_time)
701+
for label in ax2.xaxis.get_majorticklabels():
702+
label.set_fontsize(6)
703+
label.set_color(color_time)
704704

705705
ax3.plot(
706706
f[0:],
@@ -712,9 +712,9 @@ def plot_melodic_components(
712712
ax3.axes.get_yaxis().set_visible(False)
713713
ax3.autoscale_view("tight")
714714
ax3.tick_params(axis="both", which="major", pad=0)
715-
for tick in ax3.xaxis.get_major_ticks():
716-
tick.label.set_fontsize(6)
717-
tick.label.set_color(color_power)
715+
for label in ax3.xaxis.get_majorticklabels():
716+
label.set_fontsize(6)
717+
label.set_color(color_power)
718718
sns.despine(left=True, bottom=True)
719719

720720
plt.subplots_adjust(hspace=0.5)

0 commit comments

Comments
 (0)