Skip to content

Commit ea262f7

Browse files
committed
Correct outdated matplotlib API and axes logic in plotting functions
1 parent d84c41a commit ea262f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

utilities/plotting.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def plot_estimates(gamma_estimates):
6969
# length_includes_head=True, alpha=0.5, zorder=2, **{"overhang": 0.5})
7070

7171

72-
def plot_2d_domains(domains, xlim, ylim, flip_axes=False, use_current_axes=False):
72+
def plot_2d_domains(domains, xlim, ylim, flip_axes=True, use_current_axes=False):
7373
"""Plot partition dominance ranges in the (gamma, omega) plane, using the domains from CHAMP_3D.
7474
7575
Limits output to xlim and ylim dimensions. Note that the plotting here has x=gamma and y=omega.
@@ -91,7 +91,7 @@ def plot_2d_domains(domains, xlim, ylim, flip_axes=False, use_current_axes=False
9191
patches.append(polygon)
9292

9393
cnorm = matplotlib.colors.Normalize(vmin=0, vmax=len(domains))
94-
cmap = matplotlib.cm.get_cmap("Set1")
94+
cmap = plt.get_cmap("Set1")
9595
available_colors = {cmap(cnorm(i)) for i in range(len(domains))}
9696

9797
if len(available_colors) == len(domains):
@@ -207,7 +207,7 @@ def plot_2d_domains_with_num_communities(domains_with_estimates, xlim, ylim, fli
207207
plt.ylim(ylim)
208208

209209

210-
def plot_2d_domains_with_ami(domains_with_estimates, ground_truth, xlim, ylim, flip_axes=False):
210+
def plot_2d_domains_with_ami(domains_with_estimates, ground_truth, xlim, ylim, flip_axes=True):
211211
"""Plot partition dominance ranges in the (gamma, omega) plane, using the domains from CHAMP_3D and coloring by the
212212
AMI between the partitions and ground truth.
213213

0 commit comments

Comments
 (0)