supposed wordcloud fix, but everything broke
This commit is contained in:
@@ -257,17 +257,17 @@ mo.md(r"""
|
|||||||
""")
|
""")
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
_pairwise_df, _meta = S.compute_ranking_significance(char_rank)
|
# _pairwise_df, _meta = S.compute_ranking_significance(char_rank)
|
||||||
|
|
||||||
# print(_pairwise_df.columns)
|
# # print(_pairwise_df.columns)
|
||||||
|
|
||||||
mo.md(f"""
|
# mo.md(f"""
|
||||||
|
|
||||||
|
|
||||||
{mo.ui.altair_chart(S.plot_significance_heatmap(_pairwise_df, metadata=_meta))}
|
# {mo.ui.altair_chart(S.plot_significance_heatmap(_pairwise_df, metadata=_meta))}
|
||||||
|
|
||||||
{mo.ui.altair_chart(S.plot_significance_summary(_pairwise_df, metadata=_meta))}
|
# {mo.ui.altair_chart(S.plot_significance_summary(_pairwise_df, metadata=_meta))}
|
||||||
""")
|
# """)
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
mo.md(r"""
|
mo.md(r"""
|
||||||
@@ -463,34 +463,34 @@ mo.md(r"""
|
|||||||
|
|
||||||
# %%
|
# %%
|
||||||
# Compute pairwise significance tests
|
# Compute pairwise significance tests
|
||||||
pairwise_df, metadata = S.compute_pairwise_significance(
|
# pairwise_df, metadata = S.compute_pairwise_significance(
|
||||||
voice_1_10,
|
# voice_1_10,
|
||||||
test_type="mannwhitney", # or "ttest", "chi2", "auto"
|
# test_type="mannwhitney", # or "ttest", "chi2", "auto"
|
||||||
alpha=0.05,
|
# alpha=0.05,
|
||||||
correction="bonferroni" # or "holm", "none"
|
# correction="bonferroni" # or "holm", "none"
|
||||||
)
|
# )
|
||||||
|
|
||||||
# View significant pairs
|
# # View significant pairs
|
||||||
# print(pairwise_df.filter(pl.col('significant') == True))
|
# # print(pairwise_df.filter(pl.col('significant') == True))
|
||||||
|
|
||||||
# Create heatmap visualization
|
# # Create heatmap visualization
|
||||||
_heatmap = S.plot_significance_heatmap(
|
# _heatmap = S.plot_significance_heatmap(
|
||||||
pairwise_df,
|
# pairwise_df,
|
||||||
metadata=metadata,
|
# metadata=metadata,
|
||||||
title="Voice Rating Significance<br>(Pairwise Comparisons)"
|
# title="Voice Rating Significance<br>(Pairwise Comparisons)"
|
||||||
)
|
# )
|
||||||
|
|
||||||
# Create summary bar chart
|
# # Create summary bar chart
|
||||||
_summary = S.plot_significance_summary(
|
# _summary = S.plot_significance_summary(
|
||||||
pairwise_df,
|
# pairwise_df,
|
||||||
metadata=metadata
|
# metadata=metadata
|
||||||
)
|
# )
|
||||||
|
|
||||||
mo.md(f"""
|
# mo.md(f"""
|
||||||
{mo.ui.altair_chart(_heatmap)}
|
# {mo.ui.altair_chart(_heatmap)}
|
||||||
|
|
||||||
{mo.ui.altair_chart(_summary)}
|
# {mo.ui.altair_chart(_summary)}
|
||||||
""")
|
# """)
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
|
|
||||||
|
|||||||
20
plots.py
20
plots.py
@@ -1305,6 +1305,16 @@ class QualtricsPlotsMixin:
|
|||||||
# Create frequency dictionary
|
# Create frequency dictionary
|
||||||
trait_freq = Counter(traits_list)
|
trait_freq = Counter(traits_list)
|
||||||
|
|
||||||
|
# Handle empty data gracefully - return empty figure with message
|
||||||
|
if not trait_freq:
|
||||||
|
fig, ax = plt.subplots(figsize=(width/100, height/100), dpi=100)
|
||||||
|
ax.text(0.5, 0.5, "No trait data available for current filter",
|
||||||
|
ha='center', va='center', fontsize=14, color='gray',
|
||||||
|
transform=ax.transAxes)
|
||||||
|
ax.axis('off')
|
||||||
|
ax.set_title(title, fontsize=16, pad=20, color=ColorPalette.TEXT)
|
||||||
|
return fig
|
||||||
|
|
||||||
# Set random seed for color selection
|
# Set random seed for color selection
|
||||||
random.seed(random_state)
|
random.seed(random_state)
|
||||||
|
|
||||||
@@ -1335,7 +1345,15 @@ class QualtricsPlotsMixin:
|
|||||||
fig, ax = plt.subplots(figsize=(width/100, height/100), dpi=100)
|
fig, ax = plt.subplots(figsize=(width/100, height/100), dpi=100)
|
||||||
ax.imshow(wordcloud, interpolation='bilinear')
|
ax.imshow(wordcloud, interpolation='bilinear')
|
||||||
ax.axis('off')
|
ax.axis('off')
|
||||||
ax.set_title(title, fontsize=16, pad=20, color=ColorPalette.TEXT)
|
|
||||||
|
# Add title with filter subtitle (similar to _add_filter_footnote for Altair charts)
|
||||||
|
filter_text = self._get_filter_description()
|
||||||
|
if filter_text:
|
||||||
|
# Title on top, filter subtitle below in light grey
|
||||||
|
fig.suptitle(title, fontsize=16, y=0.98, color=ColorPalette.TEXT)
|
||||||
|
ax.set_title(filter_text, fontsize=10, pad=10, color='lightgrey', loc='left')
|
||||||
|
else:
|
||||||
|
ax.set_title(title, fontsize=16, pad=20, color=ColorPalette.TEXT)
|
||||||
|
|
||||||
plt.tight_layout(pad=0)
|
plt.tight_layout(pad=0)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user