# Put text annotation as background in a scatterplot

**URL:** <https://community.plotly.com/t/put-text-annotation-as-background-in-a-scatterplot/37824>\
**Category:** 📊 Plotly Python\
**Created:** [April 15, 2020, 10:48am UTC](https://community.plotly.com/t/put-text-annotation-as-background-in-a-scatterplot/37824 "2020-04-15T10:48:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nilsleh](https://avatars.discourse-cdn.com/v4/letter/n/eb8c5e/32.png) [@nilsleh](https://community.plotly.com/u/nilsleh)\
**Post date:** [April 15, 2020, 10:48am UTC](https://community.plotly.com/t/put-text-annotation-as-background-in-a-scatterplot/37824/1 "2020-04-15T10:48:08Z")

</div>

I have a plotly line chart with multiple lines and I would like to set a text annotation in the background. I added the text, before the traces, but the text still overlaps the lines (so the background text is supposed to be behind all lines and markers that appear in the chart). I checked the references, but did not find anything that would allow me to set the order in which things appear. Does someone have an idea?

![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/a/a061ed3feb11a9c052ea71c6b0e30a7e279fbe4a.png)

---

<div class="post-metadata">

**Author:** ![empet](https://avatars.discourse-cdn.com/v4/letter/e/977dab/32.png) [@empet](https://community.plotly.com/u/empet)\
**Post date:** [April 15, 2020, 11:44am UTC](https://community.plotly.com/t/put-text-annotation-as-background-in-a-scatterplot/37824/2 "2020-04-15T11:44:35Z")

</div>

You can define the text as a Scatter trace, mode= ‘text’:

```auto

import plotly.graph_objects as go
import numpy as np

y=np.random.randint(1, 8, 5)
a, b = y.min(), y.max()

tr1=go.Scatter(x=np.arange(5), y=y)
tr0=go.Scatter(x=[2], y=[(a+b)/2], mode='text', text='Background text', textposition='middle center',
               textfont_size=70, textfont_family='Sherif', textfont_color='rgba(50,50,50,0.5)', 
               showlegend=False)

fig=go.Figure(data=[tr0, tr1])

```

 ![newplot](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/e/e635766333e047db6c3d3343cf6d704df9155ab8.png)
