Skip to content

Commit

Permalink
resolved merge conflict of plot_summaries.py
Browse files Browse the repository at this point in the history
  • Loading branch information
simonleandergrimm committed Nov 28, 2023
2 parents 279fa0e + c2d787f commit 77700b9
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions plot_summaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def plot_violin(
y: str,
sorting_order: list[str],
ascending: list[bool],
hatch_zero_counts: bool = False,
hatch_zero_counts: bool = True,
violin_scale=1.0,
) -> None:
assert len(sorting_order) == len(ascending)
Expand Down Expand Up @@ -114,7 +114,7 @@ def plot_violin(
path.vertices[:, 1] = (
violin_scale * (path.vertices[:, 1] - y_mid) + y_mid
)
if (not hatch_zero_counts) and (num_reads == 0):
if (hatch_zero_counts) and (num_reads == 0):
color = patches.get_facecolor()
y_max = np.max(path.vertices[:, 1])
y_min = np.min(path.vertices[:, 1])
Expand Down Expand Up @@ -166,7 +166,7 @@ def plot_incidence(data: pd.DataFrame, input_data: pd.DataFrame) -> plt.Figure:
ascending=[False, True, False, True, False],
violin_scale=2.0,
)
ax.set_xlim((-13, -3))
ax.set_xlim(-13.0, -3.0)
separate_viruses(ax)
adjust_axes(ax, predictor_type=predictor_type)
legend = ax.legend(
Expand All @@ -176,8 +176,8 @@ def plot_incidence(data: pd.DataFrame, input_data: pd.DataFrame) -> plt.Figure:
borderaxespad=0,
frameon=False,
)
for legend_handle in legend.legend_handles:
legend_handle.set_edgecolor(legend_handle.get_facecolor())
for legend_handle in legend.legend_handles: # type: ignore
legend_handle.set_edgecolor(legend_handle.get_facecolor()) # type: ignore
return fig


Expand Down Expand Up @@ -208,6 +208,7 @@ def plot_prevalence(
violin_scale=1.5,
)
ax.set_xlim((-15, -7))
ax.set_xlim(-15, -7)
ax.set_xticks(list(range(-15, -5, 2)))
separate_viruses(ax)
# TODO Get these values automatically
Expand Down Expand Up @@ -239,8 +240,8 @@ def plot_prevalence(
borderaxespad=0,
frameon=False,
)
for legend_handle in legend.legend_handles:
legend_handle.set_edgecolor(legend_handle.get_facecolor())
for legend_handle in legend.legend_handles: # type: ignore
legend_handle.set_edgecolor(legend_handle.get_facecolor()) # type: ignore
return fig


Expand All @@ -265,7 +266,7 @@ def plot_three_virus(
sorting_order=["study", "location"],
ascending=[False, True],
violin_scale=2.5,
hatch_zero_counts=True,
hatch_zero_counts=False,
)
ax.set_xlim(xlim)
# TODO Get these values automatically
Expand Down

0 comments on commit 77700b9

Please sign in to comment.