Skip to content

Commit

Permalink
Merge pull request #11 from mooscaliaproject/fix/crowding_distance_w_…
Browse files Browse the repository at this point in the history
…dups

STYLE: Ruff formatting
  • Loading branch information
bruscalia authored Nov 20, 2024
2 parents 6ef17ac + 2f7e92b commit 31eb4c9
Show file tree
Hide file tree
Showing 17 changed files with 1,295 additions and 994 deletions.
16 changes: 7 additions & 9 deletions docs/source/Theory/Rank-and-Crowding.ipynb

Large diffs are not rendered by default.

46 changes: 26 additions & 20 deletions docs/source/Theory/plots.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
import matplotlib.pyplot as plt


def plot_pairs_3d(first, second, colors=("indigo", "firebrick"), **kwargs):

fig, ax = plt.subplots(1, 2, subplot_kw={'projection':'3d'}, **kwargs)
def plot_pairs_3d(first, second, colors=('indigo', 'firebrick'), **kwargs):
fig, ax = plt.subplots(1, 2, subplot_kw={'projection': '3d'}, **kwargs)

ax[0].scatter(
*first[1].T,
color=colors[0], label=first[0], marker="o",
color=colors[0],
label=first[0],
marker='o',
)
ax[0].set_ylabel("$f_2$")
ax[0].set_xlabel("$f_1$")
ax[0].set_zlabel("$f_3$")
ax[0].set_ylabel('$f_2$')
ax[0].set_xlabel('$f_1$')
ax[0].set_zlabel('$f_3$')
ax[0].legend()

ax[1].scatter(
*second[1].T,
color=colors[1], label=second[0], marker="o",
color=colors[1],
label=second[0],
marker='o',
)
ax[1].set_ylabel("$f_2$")
ax[1].set_xlabel("$f_1$")
ax[1].set_zlabel("$f_3$")
ax[1].set_ylabel('$f_2$')
ax[1].set_xlabel('$f_1$')
ax[1].set_zlabel('$f_3$')
ax[1].legend()

ax[0].view_init(elev=30, azim=30)
Expand All @@ -30,25 +33,28 @@ def plot_pairs_3d(first, second, colors=("indigo", "firebrick"), **kwargs):
plt.show()


def plot_pairs_2d(first, second, colors=("indigo", "firebrick"), **kwargs):

def plot_pairs_2d(first, second, colors=('indigo', 'firebrick'), **kwargs):
fig, ax = plt.subplots(1, 2, **kwargs)

ax[0].scatter(
*first[1].T,
color=colors[0], label=first[0], marker="o",
color=colors[0],
label=first[0],
marker='o',
)
ax[0].set_ylabel("$f_2$")
ax[0].set_xlabel("$f_1$")
ax[0].set_ylabel('$f_2$')
ax[0].set_xlabel('$f_1$')
ax[0].legend()

ax[1].scatter(
*second[1].T,
color=colors[1], label=second[0], marker="o",
color=colors[1],
label=second[0],
marker='o',
)
ax[1].set_ylabel("$f_2$")
ax[1].set_xlabel("$f_1$")
ax[1].set_ylabel('$f_2$')
ax[1].set_xlabel('$f_1$')
ax[1].legend()

fig.tight_layout()
plt.show()
plt.show()
Loading

0 comments on commit 31eb4c9

Please sign in to comment.