Skip to content

Commit

Permalink
fix colormap
Browse files Browse the repository at this point in the history
  • Loading branch information
thayeral committed Oct 18, 2023
1 parent ab6cb9c commit 6994d79
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions src/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,21 +584,22 @@ def plot_heatmap_p2v(
bins=25,
color='dimgrey'
)
ax1.tick_params(axis='y', labelcolor='grey', color='grey')

ax1t = ax1.twinx()
ax1t = sns.ecdfplot(
ax=ax1t,
data=x,
x=hist_col,
stat='proportion',
color='C2',
linestyle=':',
color='k',
# linestyle=':',
)
ax1t.tick_params(axis='y', labelcolor='C2', color='C2')
ax1t.set_ylabel('CDF', color='C2')
ax1t.tick_params(axis='y', labelcolor='k', color='k')
ax1t.set_ylabel('CDF', color='k')

ax1.axvline(np.median(x[hist_col]), c='C0', ls='-', lw=2, label='Median')
ax1.axvline(np.mean(x[hist_col]), c='C1', ls='--', lw=2, label='Mean')
ax1.axvline(np.median(x[hist_col]), c='C0', ls='--', lw=2, label='Median')
ax1.axvline(np.mean(x[hist_col]), c='C1', ls=':', lw=2, label='Mean')
ax1.set_ylim(0, 30)
ax1.set_xlim(0, xmax)
ax1.set_xlabel(color_label)
Expand Down Expand Up @@ -637,20 +638,22 @@ def plot_heatmap_p2v(
bins=25,
color='dimgrey'
)
ax2.tick_params(axis='y', labelcolor='grey', color='grey')

ax2t = ax2.twinx()
ax2t = sns.ecdfplot(
ax=ax2t,
data=x,
x=hist_col,
stat='proportion',
color='C2',
linestyle=':',
color='k',
# linestyle=':',
)
ax2t.tick_params(axis='y', labelcolor='C2', color='C2')
ax2t.set_ylabel('CDF', color='C2')
ax2t.tick_params(axis='y', labelcolor='k', color='k')
ax2t.set_ylabel('CDF', color='k')

ax2.axvline(np.median(x[hist_col]), c='C0', ls='-', lw=2)
ax2.axvline(np.mean(x[hist_col]), c='C1', ls='--', lw=2)
ax2.axvline(np.median(x[hist_col]), c='C0', ls='--', lw=2)
ax2.axvline(np.mean(x[hist_col]), c='C1', ls=':', lw=2)
ax2.set_ylim(0, 30)
ax2.set_xlim(0, xmax)
ax2.set_xlabel(color_label)
Expand Down Expand Up @@ -689,21 +692,22 @@ def plot_heatmap_p2v(
bins=25,
color='dimgrey'
)
ax3.tick_params(axis='y', labelcolor='grey', color='grey')

ax3t = ax3.twinx()
ax3t = sns.ecdfplot(
ax=ax3t,
data=x,
x=hist_col,
stat='proportion',
color='C2',
linestyle=':',
color='k',
# linestyle=':',
)
ax3t.tick_params(axis='y', labelcolor='C2', color='C2')
ax3t.set_ylabel('CDF', color='C2')
ax3t.tick_params(axis='y', labelcolor='k', color='k')
ax3t.set_ylabel('CDF', color='k')

ax3.axvline(np.median(x[hist_col]), c='C0', ls='-', lw=2)
ax3.axvline(np.mean(x[hist_col]), c='C1', ls='--', lw=2)
ax3.axvline(np.median(x[hist_col]), c='C0', ls='--', lw=2)
ax3.axvline(np.mean(x[hist_col]), c='C1', ls=':', lw=2)
ax3.set_ylim(0, 30)
ax3.set_xlim(0, xmax)
ax3.set_xlabel(color_label)
Expand Down

0 comments on commit 6994d79

Please sign in to comment.