# Intersection Symbol in Latex with PyPlotJS

**URL:** <https://discourse.julialang.org/t/intersection-symbol-in-latex-with-pyplotjs/85462>\
**Category:** General Usage\
**Tags:** pyplotjs\
**Created:** [August 8, 2022, 6:02am UTC](https://discourse.julialang.org/t/intersection-symbol-in-latex-with-pyplotjs/85462 "2022-08-08T06:02:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [August 8, 2022, 6:02am UTC](https://discourse.julialang.org/t/intersection-symbol-in-latex-with-pyplotjs/85462/1 "2022-08-08T06:02:50Z")

</div>

Hi all,

I am playing around by creating venn diagram today, I want to know why I can’t make the intersection symbol appeared? Is it impossible? Thanks

Here is the code:

```julia
using PlotlyJS, LaTeXStrings

# Create scatter trace of text labels
p = plot(scatter(
    x=[1, 1.75, 2.5, 1.75],
    y=[1, 1, 1, 2.5],
    text=["A", L"A \cap B", "B", "C"],
    mode="text",
    textfont=attr(
        color="black",
        size=18,
        family="Arail",
    )
))

# Update axes properties

update_xaxes!(p,
    showticklabels=false,
    showgrid=false,
    zeroline=false,
)

update_yaxes!(p,
    showticklabels=false,
    showgrid=false,
    zeroline=false,
)

relayout!(
    p,
    margin=attr(l=20, r=20, b=100),
    height=600, width=800,
    plot_bgcolor="white",
    # Add circles
    shapes=[
        circle(
            line_color="blue", fillcolor="blue",
            x0=0, y0=0, x1=2, y1=2,
            opacity=0.3, xref="x", yref="y"
        ),
        circle(
            line_color="gray", fillcolor="gray",
            x0=1.5, y0=0, x1=3.5, y1=2,
            opacity=0.3, xref="x", yref="y"
        )
	,
        circle(
            line_color="green", fillcolor="green",
            x0=0.75, y0=1.5, x1=2.75, y1=3.5,
            opacity=0.3, xref="x", yref="y"
        )
    ]
)

p

```

 ![Capture d’écran_2022-08-08_13-02-33](https://global.discourse-cdn.com/julialang/original/3X/8/e/8effd5ea258782765977604e78a6fb0c1ee452ed.png)

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [August 8, 2022, 6:35am UTC](https://discourse.julialang.org/t/intersection-symbol-in-latex-with-pyplotjs/85462/2 "2022-08-08T06:35:43Z")

</div>

Did you figure this one out here?

> [@Plots + PlotlyJS + LaTeX](https://discourse.julialang.org/t/plots-plotlyjs-latex/38250/14):
>
> I try your code, it works if I use "cdn", but not if only using "" using LaTeXStrings, Plots plotlyjs() plot(1:4, [[1,4,9,16]\*10000, [0.5, 2, 4.5, 8]], labels = [L"\alpha\_{1c} = 352 \pm 11 \text{ km s}^{-1}"; L"\beta\_{1c} = 25 \pm 11 \text{ km s}^{-1}"] |\> permutedims, xlabel = L"\sqrt{(n\_\text{c}(t|{T\_\text{early}}))}", ylabel = L"d, r \text{ (solar radius)}", yformatter = :plain, extra\_plot\_kwargs = KW( …

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [August 8, 2022, 6:56am UTC](https://discourse.julialang.org/t/intersection-symbol-in-latex-with-pyplotjs/85462/3 "2022-08-08T06:56:20Z")

</div>

Haha that’s my old question, yes still not working, I save it to html but it is not working like the old thread/forum.

this is the code:

```julia
using LaTeXStrings, Plots
plotlyjs()

# Create scatter trace of text labels
p = plot(scatter(
    x=[1, 1.75, 2.5, 1.75],
    y=[1, 1, 1, 2.5],
    text=["A", L"A \cap B", "B", "C"],
    mode="text",
    textfont=attr(
        color="black",
        size=18,
        family="Arail",
    ),
    extra_plot_kwargs = KW(
               :include_mathjax => "cdn",
               :yaxis => KW(:automargin => true),
               :xaxis => KW(:domain => "auto")
               ),
))

# Update axes properties

update_xaxes!(p,
    showticklabels=false,
    showgrid=false,
    zeroline=false,
)

update_yaxes!(p,
    showticklabels=false,
    showgrid=false,
    zeroline=false,
)

relayout!(
    p,
    margin=attr(l=20, r=20, b=100),
    height=600, width=800,
    plot_bgcolor="white",
    # Add circles
    shapes=[
        circle(
            line_color="blue", fillcolor="blue",
            x0=0, y0=0, x1=2, y1=2,
            opacity=0.3, xref="x", yref="y"
        ),
        circle(
            line_color="gray", fillcolor="gray",
            x0=1.5, y0=0, x1=3.5, y1=2,
            opacity=0.3, xref="x", yref="y"
        )
	,
        circle(
            line_color="green", fillcolor="green",
            x0=0.75, y0=1.5, x1=2.75, y1=3.5,
            opacity=0.3, xref="x", yref="y"
        ),
    ]
)

#show image
#p
PlotlyJS.savefig(p, "myimage.html")

```

 ![Capture d’écran_2022-08-08_13-53-29](https://global.discourse-cdn.com/julialang/original/3X/9/c/9c7102956d4556e9f8e3e1b05cbb5eaa0f20aaee.png)

---

<div class="post-metadata">

**Author:** ![empet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/empet/32/221303_2.png) [@empet](https://discourse.julialang.org/u/empet)\
**Post date:** [August 8, 2022, 7:01am UTC](https://discourse.julialang.org/t/intersection-symbol-in-latex-with-pyplotjs/85462/4 "2022-08-08T07:01:25Z")

</div>

To get the right rendering for `$A\cap B$`, type the string `"A&#8745;B"`, where `&#8745;` is the html code for `\cap`, or  
the string `"A\u2229 B"`, with `\u2229`, the unicode for `\cap`: [https://unicode-table.com/en/2229/](https://unicode-table.com/en/2229/) .

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [August 8, 2022, 7:26am UTC](https://discourse.julialang.org/t/intersection-symbol-in-latex-with-pyplotjs/85462/5 "2022-08-08T07:26:06Z")

</div>

Thanks a lot,

the string is working (thus I do not need to use kwargs anymore).

But the unicode `\u2229` is not working with kwargs and html image.

I want to know the list of strings like `&#8745;` that can be used as replacement for Latex strings

---

<div class="post-metadata">

**Author:** ![empet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/empet/32/221303_2.png) [@empet](https://discourse.julialang.org/u/empet)\
**Post date:** [August 8, 2022, 7:47am UTC](https://discourse.julialang.org/t/intersection-symbol-in-latex-with-pyplotjs/85462/6 "2022-08-08T07:47:13Z")

</div>

Usually I’m googling: “the unicode and html for Latex `\symbol`”, and there are a lot of sites displaying both.

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [August 8, 2022, 7:49am UTC](https://discourse.julialang.org/t/intersection-symbol-in-latex-with-pyplotjs/85462/7 "2022-08-08T07:49:39Z")

</div>

There’s a Julia package for that, too. 😂

> **[GitHub - cormullion/Glyphy.jl: I will look for you. I will find you. And I...](https://github.com/cormullion/Glyphy.jl)**
>
> I will look for you. I will find you. And I will print you. (If you're a Unicode glyph...) - GitHub - cormullion/Glyphy.jl: I will look for you. I will find you. And I will print you. (If you&#...
