Skip to content

Commit d9a61aa

Browse files
authored
DOC avoid clipping axis name in example (#827)
1 parent 331c603 commit d9a61aa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

examples/over-sampling/plot_shrinkage_effect.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
ax.add_artist(class_legend)
4444
ax.set_xlabel("Feature #1")
4545
_ = ax.set_ylabel("Feature #2")
46+
plt.tight_layout()
4647

4748
# %%
4849
# Now, we will use a :class:`~imblearn.over_sampling.RandomOverSampler` to
@@ -61,6 +62,7 @@
6162
ax.add_artist(class_legend)
6263
ax.set_xlabel("Feature #1")
6364
_ = ax.set_ylabel("Feature #2")
65+
plt.tight_layout()
6466
# %%
6567
# We observe that the minority samples are less transparent than the samples
6668
# from the majority class. Indeed, it is due to the fact that these samples
@@ -79,6 +81,7 @@
7981
ax.add_artist(class_legend)
8082
ax.set_xlabel("Feature #1")
8183
_ = ax.set_ylabel("Feature #2")
84+
plt.tight_layout()
8285

8386
# %%
8487
# In this case, we see that the samples in the minority class are not
@@ -97,6 +100,7 @@
97100
ax.add_artist(class_legend)
98101
ax.set_xlabel("Feature #1")
99102
_ = ax.set_ylabel("Feature #2")
103+
plt.tight_layout()
100104

101105
# %%
102106
# Increasing the value of `shrinkage` will disperse the new samples. Forcing
@@ -112,6 +116,7 @@
112116
ax.add_artist(class_legend)
113117
ax.set_xlabel("Feature #1")
114118
_ = ax.set_ylabel("Feature #2")
119+
plt.tight_layout()
115120

116121
# %%
117122
# Therefore, the `shrinkage` is handy to manually tune the dispersion of the

0 commit comments

Comments
 (0)