lynn-twinkl
commited on
Commit
·
fb8ff02
1
Parent(s):
29af03a
changed colors; centered hovertext
Browse files- src/px_charts.py +7 -3
src/px_charts.py
CHANGED
|
@@ -8,7 +8,7 @@ def plot_histogram(df: pd.DataFrame, col_to_plot: str, bins: int, height: int =
|
|
| 8 |
x=col_to_plot,
|
| 9 |
nbins=bins,
|
| 10 |
title=None,
|
| 11 |
-
color_discrete_sequence=['#
|
| 12 |
)
|
| 13 |
|
| 14 |
plt.update_layout(
|
|
@@ -40,8 +40,10 @@ def plot_topic_countplot(topics_df: pd.DataFrame, topic_id_col: str, topic_name_
|
|
| 40 |
title=None,
|
| 41 |
)
|
| 42 |
|
|
|
|
|
|
|
| 43 |
plt.update_traces(
|
| 44 |
-
marker_color='#
|
| 45 |
textposition='outside',
|
| 46 |
hovertemplate=(
|
| 47 |
'Topic Name: %{customdata[1]}<br>'
|
|
@@ -54,9 +56,11 @@ def plot_topic_countplot(topics_df: pd.DataFrame, topic_id_col: str, topic_name_
|
|
| 54 |
uniformtext_minsize=10,
|
| 55 |
height=height,
|
| 56 |
hoverlabel=dict(
|
| 57 |
-
font_size=
|
|
|
|
| 58 |
)
|
| 59 |
)
|
| 60 |
|
| 61 |
|
|
|
|
| 62 |
return plt
|
|
|
|
| 8 |
x=col_to_plot,
|
| 9 |
nbins=bins,
|
| 10 |
title=None,
|
| 11 |
+
color_discrete_sequence=['#646DEF']
|
| 12 |
)
|
| 13 |
|
| 14 |
plt.update_layout(
|
|
|
|
| 40 |
title=None,
|
| 41 |
)
|
| 42 |
|
| 43 |
+
plt.update_xaxes(type='category')
|
| 44 |
+
|
| 45 |
plt.update_traces(
|
| 46 |
+
marker_color='#EF64B3',
|
| 47 |
textposition='outside',
|
| 48 |
hovertemplate=(
|
| 49 |
'Topic Name: %{customdata[1]}<br>'
|
|
|
|
| 56 |
uniformtext_minsize=10,
|
| 57 |
height=height,
|
| 58 |
hoverlabel=dict(
|
| 59 |
+
font_size=13,
|
| 60 |
+
align="left"
|
| 61 |
)
|
| 62 |
)
|
| 63 |
|
| 64 |
|
| 65 |
+
|
| 66 |
return plt
|