code: def test_histfunc_hoverlabels_bivariate():
      def check_label(label, fig):
          assert fig.layout.yaxis.title.text == label
          assert label + "=" in fig.data[0].hovertemplate
  
      df = px.data.tips()
  
      # with y, should be same as forcing histfunc to sum
      fig = px.histogram(df, x="total_bill", y="tip")
      check_label("sum of tip", fig)
  
      # change probability to fraction when histfunc is sum
      fig = px.histogram(
          df, x="total_bill", y="tip", histnorm="probability"
      )
      check_label("fraction of sum of tip", fig)
  
      # percent is percent
      fig = px.histogram(
          df, x="total_bill", y="tip", histnorm="percent"
      )
      check_label("percent of sum of tip", fig)
  
      # the other two are "weighted by"
      for histnorm in ["density", "probability density"]:
          fig = px.histogram(
              df, x="total_bill", y="tip", histnorm=histnorm
          )
          check_label("%s weighted by tip" % histnorm, fig)
  
      # check a few "normalized by"
      for histnorm in ["density", "probability density"]:
          for barnorm in ["fraction", "percent"]:
              fig = px.histogram(
                  df,
                  x="total_bill",
                  y="tip",
                  histnorm=histnorm,
                  barnorm=barnorm,
              )
              check_label(
                  "%s weighted by tip (normalized as %s)"
                  % (histnorm, barnorm),
                  fig,
              )
  
      # these next two are weird but OK...
      fig = px.histogram(
          df,
          x="total_bill",
          y="tip",
          histfunc="min",
          histnorm="probability",
          barnorm="percent",
      )
      check_label(
          "fraction of sum of min of tip (normalized as percent)", fig
      )
  
      fig = px.histogram(
          df,
          x="total_bill",
          y="tip",
          histfunc="avg",
          histnorm="percent",
          barnorm="fraction",
      )
      check_label(
          "percent of sum of avg of tip (normalized as fraction)", fig
      )
  
      # this next one is basically "never do this" but needs a defined behaviour
      fig = px.histogram(
          df,
          x="total_bill",
          y="tip",
          histfunc="max",
          histnorm="density",
      )
      check_label("density of max of tip", fig)
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_optional/test_px/test_px_functions.py
imports: import plotly.express
  import plotly.graph_objects
  from numpy.testing import assert_array_equal
  import numpy
  import pandas
  import pytest
label_desc: Use image node_id 13 for calling a global function with example usage: test_histfunc_hoverlabels_bivariate() without return types