# Plotly Scatter Text Special Character

**URL:** <https://community.plotly.com/t/plotly-scatter-text-special-character/68041>\
**Category:** 📊 Plotly Python\
**Created:** [September 17, 2022, 8:56am UTC](https://community.plotly.com/t/plotly-scatter-text-special-character/68041 "2022-09-17T08:56:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stef007](https://avatars.discourse-cdn.com/v4/letter/s/ed8c4c/32.png) [@stef007](https://community.plotly.com/u/stef007)\
**Post date:** [September 17, 2022, 8:56am UTC](https://community.plotly.com/t/plotly-scatter-text-special-character/68041/1 "2022-09-17T08:56:02Z")

</div>

I am having trouble in renewing special character (i.e. from fontawesome) in Scatter’s text. In the example below the text is showing hollow squares only.

Tree structure were font awesome is locally installed:  
 ![sample](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/4/3/439819568af942a1fcc57b43dd383d330ddb3f84.png)

Here is the code:

```auto
import plotly.graph_objects as go
import dash
from dash import dcc, html
import dash_bootstrap_components as dbc
import fontawesome as fa

text = fa.icons['clock']
print(text)

fa_text = html.Div(
    [
        html.P(
            'please come home',
            style={
                'color': 'green',
                'display': 'inline-block'
            }
        ),
        html.P(
            className='fa-regular fa-chart-bar fa-xl m-3',
            style={
                'color': 'green',
                'display': 'inline-block'
            }
        ),
    ]
)
fig = go.Figure()
fig.add_trace(
    go.Scatter(
        x=[0, 1, 2],
        y=[1, 1, 1],
        mode="lines+markers+text",
        name="Lines, Markers and Text",
        text=[text, 'Header-1', text],
        textposition="top center",
        textfont=dict(
            family='Font Awesome 5 Free',
            size=12,
            color='red'
        ),
    )
)

app = dash.Dash(
    __name__ ,
    title='Phase3-App',
)

app.layout = dbc.Container(
    [
        html.Div(
            [
                html.Hr(),
                fa_text,
                dcc.Graph(
                    id='xyz',
                    figure=fig
                ),
            ]
        ),
    ],
    fluid=True
)

if __name__ == ' __main__':
    app.run_server(port=8050, debug=True)

```

---

<div class="post-metadata">

**Author:** ![tphil10](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/tphil10/32/19868_2.png) [@tphil10](https://community.plotly.com/u/tphil10)\
**Post date:** [September 17, 2022, 8:12pm UTC](https://community.plotly.com/t/plotly-scatter-text-special-character/68041/2 "2022-09-17T20:12:18Z")

</div>

Is there a python package for font awesome? That’s cool if there is but the usual way I get icons to work is by importing them as a stylesheet

```auto
app = Dash( __name__ ,
           external_stylesheets=[
               'https://use.fontawesome.com/releases/v5.8.1/css/all.css'
           ]
           )

```

and then placing an I component somewhere

```auto
html.I(className='fas fa-home fa-fw fa-lg')],

```

---

<div class="post-metadata">

**Author:** ![Stephan.Katz](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@Stephan.Katz](https://community.plotly.com/u/Stephan.Katz)\
**Post date:** [September 18, 2022, 4:42am UTC](https://community.plotly.com/t/plotly-scatter-text-special-character/68041/3 "2022-09-18T04:42:53Z")

</div>

Yes there is fontawesome package. However, the topic point is about displaying fontawesome text in the Text Attribute of Scatter Plot

---

<div class="post-metadata">

**Author:** ![tphil10](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/tphil10/32/19868_2.png) [@tphil10](https://community.plotly.com/u/tphil10)\
**Post date:** [September 18, 2022, 2:41pm UTC](https://community.plotly.com/t/plotly-scatter-text-special-character/68041/4 "2022-09-18T14:41:56Z")

</div>

Hmm yea i see the same thing, I’m not sure this can be done that way but i’m still tinkering with it.  
One post from a bit ago got it working using the unicode version of some icons:

[https://community.plotly.com/t/i-want-to-use-custom-icon-for-the-scatter-markers-how-to-do-it/6644](https://community.plotly.com/t/i-want-to-use-custom-icon-for-the-scatter-markers-how-to-do-it/6644)
