Incorrect Hover Text

I’m creating a plot and would like the hovertext to indicate the instance number. Below is my code:

import plotly.plotly as py
import plotly.figure_factory as ff

fig = ff.create_facet_grid(
    df,
    x='lgbm_prob',
    y='lr_prob',
    facet_row='lgbm_quad',
    facet_col='lr_quad',
    text = df.instance,
    color_name='lgbm_quad'
)
iplot(fig)

In the plot, the instance number shown in the hover text is 992 but the x-axis and y-axis number doesn’t corresponds to the dataset. The instance number that corresponds to those values should be 9375. i used a single dataframe for the plot and text, why is there a discrepancy?

I would recommend using plotly_express instead of the figurefactory (https://medium.com/@plotlygraphs/introducing-plotly-express-808df010143d).

import plotly_express as px

df.scatter(
    df,
    x='lgbm_prob',
    y='lr_prob',
    facet_row='lgbm_quad',
    facet_col='lr_quad',
    hover_data = ['lgbm_prob','lr_prob', 'lgbm_quad', 'lr_quad',  'instance']
    color='lgbm_quad'
)

Thanks! this instance is showing up correctly now