Skip to content

Commit

Permalink
Correct outdated matplotlib API and axes logic in plotting functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ragibson committed Jun 4, 2024
1 parent d84c41a commit ea262f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utilities/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def plot_estimates(gamma_estimates):
# length_includes_head=True, alpha=0.5, zorder=2, **{"overhang": 0.5})


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

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

if len(available_colors) == len(domains):
Expand Down Expand Up @@ -207,7 +207,7 @@ def plot_2d_domains_with_num_communities(domains_with_estimates, xlim, ylim, fli
plt.ylim(ylim)


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

0 comments on commit ea262f7

Please sign in to comment.