Histogram should not prepend any text to axis and hover labels (e.g. "sum of ...")
Split from #2876
We need to localize all texts in our project. So, we can't rely on auto-generated, English labels such as "sum of" or "probability."
Issue
The following code produces the correct chart. However, the auto-generated phrase "sum of" appears in the axis label and hover text.
px.histogram(
chart_data,
x="role_name",
y="total_minutes",
color="work_type",
labels={
# notice here the use of _("") localization function
"role_name": _("Caregiver role"),
"total_minutes": _("total minutes"),
"work_type": _("Type of work"),
},
)


Expected outcome
The desired output would be that the y-axis label and hover text would be "total minutes" rather than "sum of total minutes," the latter of which we cannot localize. Specifically, when labels are defined for chart dimensions, the aggregation type ("sum of" in this case) should not be prepended to the text, since the content and data language may not be English.
This requests makes sense but can't make it the default behaviour as 1) it would be a backwards-incompatible change and 2) when doing exploratory analysis it's extremely important that the Y axis correctly displays the operation being done on the data.
I would be open to a pull request which added a flag to all PX functions that accept histnorm to suppress this output.
Hi, Brylie, I have encountered the same problem, have you found a way to remove the "sum of" from the y-axis label?
I was able to remove the text using the example from @nicolaskruchten
https://github.com/plotly/plotly.py/issues/2876#issuecomment-1111339561