# How to fit text into hover box in python plotly

**URL:** https://community.plotly.com/t/how-to-fit-text-into-hover-box-in-python-plotly/52295
**Category:** 📊 Plotly Python
**Created:** [April 23, 2021, 2:50pm UTC](https://community.plotly.com/t/how-to-fit-text-into-hover-box-in-python-plotly/52295 "2021-04-23T14:50:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![freita](https://avatars.discourse-cdn.com/v4/letter/f/e9c0ed/32.png) [@freita](https://community.plotly.com/u/freita)
#### Post date: [April 23, 2021, 2:50pm UTC](https://community.plotly.com/t/how-to-fit-text-into-hover-box-in-python-plotly/52295/1 "2021-04-23T14:50:33Z")

</div>

Hello everyone.  
I need to plot a world map and display some information in the hover box using plotly in python. But my text is too big to fit in the screen (I have attached one example at the end)

In my case I have the following code:

```auto
import plotly.express as px

fig = px.scatter_mapbox(df2, lat="latitude", lon="longitude", hover_name="Country", hover_data=["Breed"],
                    color_discrete_sequence=["fuchsia"], zoom=3, height=1000)
fig.update_layout(mapbox_style="open-street-map")
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0})
fig.update_layout(
    hoverlabel=dict(
        bgcolor="white",
        font_size=11,
        font_family="Rockwell"
    )
)

```

But in my case, some countries have too much information to display (Breeds). Like in the image below:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/e/efa03a3eeccd3075433ecfb1e9d087ffe628965a.jpeg)

I have found this answer but did not work: [Customize Hover Box Plotly: Python to Fit Text](https://stackoverflow.com/questions/29454114/customize-hover-box-plotly-python-to-fit-text/67221625#67221625)

Any ideas would be very appreciated.
