Displaying Base and Feature Counts in Scatter Plot Hover Text Using Plotly
To create a hover text that includes both the base and feature counts for each class, you can modify the hovertext parameter in the Scatter function to use the hover2 column.
Here’s an example of how you can do it:
fig.add_traces(go.Scatter(x=df2['num_missed_base'], y=df2['num_missed_feature'],
mode='markers', marker=dict(color='red',
line=dict(color='black', width=1),
size=14),
hovertext=df2['hover2'] + "<br>" + df2["hover"],
hoverinfo="text",
))
This will create a hover text that displays the base and feature counts for each class, with the feature count on one line and the base count on the next.
Note: The df2['hover'] is used as an additional value in the hovertext, which means it will be displayed below the main value.
This should give you a hover text that shows both the base and feature counts for each class, making it easier to understand the data when hovering over the points.
Last modified on 2023-06-20