Skip to content

Commit

Permalink
fix(plots): parameterize inclusion of complete angular scale
Browse files Browse the repository at this point in the history
Signed-off-by: Cameron Smith <cameron.ray.smith@gmail.com>
  • Loading branch information
cameronraysmith committed Sep 17, 2024
1 parent c2ede44 commit f31d116
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/pyrovelocity/plots/_vector_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def plot_vector_field_summary(
save_fig: bool = False,
linewidth: float = 0.5,
title_background_color: str = "#F0F0F0",
force_complete_angular_scale: bool = False,
) -> FigureBase:
posterior_time = posterior_samples["cell_time"]
pca_embeds_angle = posterior_samples["pca_embeds_angle"]
Expand Down Expand Up @@ -216,6 +217,7 @@ def plot_vector_field_summary(
cmap="inferno",
cmax=None,
show_titles=False,
force_complete_angular_scale=force_complete_angular_scale,
)
ax[3].set_title(
r"PCA angle uncertainty"
Expand Down Expand Up @@ -314,7 +316,7 @@ def plot_vector_field_summary(
r"$\left.\hat{\sigma}(t) \right/ \hat{\mu}(t)$",
]
colorbar_ticks = [
[0, 360],
[0, 360] if force_complete_angular_scale else [],
[0, 1],
[],
]
Expand Down Expand Up @@ -394,6 +396,7 @@ def plot_vector_field_uncertainty(
show_titles: bool = True,
default_fontsize: int = 7,
plot_individual_obs: bool = False,
force_complete_angular_scale: bool = False,
):
if uncertain_measure == "angle":
adata.obs["uncertain"] = get_posterior_sample_angle_uncertainty(
Expand Down Expand Up @@ -489,11 +492,9 @@ def plot_vector_field_uncertainty(
norm=None,
vmin=0
if "angle" in uncertain_measure
# else np.percentile(ordered_uncertainty_measure, 0.1),
else min(ordered_uncertainty_measure),
vmax=360
if "angle" in uncertain_measure
# else np.percentile(ordered_uncertainty_measure, 99.9),
if force_complete_angular_scale
else max(ordered_uncertainty_measure),
s=dotsize,
linewidth=1,
Expand All @@ -510,7 +511,7 @@ def plot_vector_field_uncertainty(
if "angle" in uncertain_measure
else min(ordered_uncertainty_measure),
vmax=360
if "angle" in uncertain_measure
if force_complete_angular_scale
else max(ordered_uncertainty_measure),
linewidths=0,
edgecolors="none",
Expand Down

0 comments on commit f31d116

Please sign in to comment.