# Italic string in a plot, how?

**URL:** <https://discourse.julialang.org/t/italic-string-in-a-plot-how/88036>\
**Category:** General Usage\
**Tags:** strings, plots\
**Created:** [September 30, 2022, 12:36pm UTC](https://discourse.julialang.org/t/italic-string-in-a-plot-how/88036 "2022-09-30T12:36:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![fdamore](https://avatars.discourse-cdn.com/v4/letter/f/b2d939/32.png) [@fdamore](https://discourse.julialang.org/u/fdamore)\
**Post date:** [September 30, 2022, 12:36pm UTC](https://discourse.julialang.org/t/italic-string-in-a-plot-how/88036/1 "2022-09-30T12:36:45Z")

</div>

Hi, I’m trying to create a plot with Plots: without using Latex, how can one make an italic label for the axes?  
Thanks!

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [September 30, 2022, 4:20pm UTC](https://discourse.julialang.org/t/italic-string-in-a-plot-how/88036/2 "2022-09-30T16:20:40Z")

</div>

[One solution is posted here](https://discourse.julialang.org/t/makie-text-with-variable-styling/81666/8) using unicode. Just copy and paste your text from the website linked, to the Plots’ labels inside `raw""`:

```julia
using Plots
scatter(rand(10,10), xlabel=raw"𝑳𝒂𝒃𝒆𝒍 𝒊𝒏 𝒊𝒕𝒂𝒍𝒊𝒄")

```

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [September 30, 2022, 4:25pm UTC](https://discourse.julialang.org/t/italic-string-in-a-plot-how/88036/3 "2022-09-30T16:25:26Z")

</div>

That’s quite clever, as a workaround, and works with English and no other(?) (European) languages. Also works for bold and/or italics.

Works for my (Icelandic) name: “`𝑃𝑎́𝑙𝑙` Haraldsson”, but not for e.g. [Páll] Þorkellsson, had I been the son of Þorkell. EDIT, maybe I spoke too soon, copying into the REPL, it looks odd, but that may or may not apply to your plotting package (I suppose could depend, e.g. working for web based ones?).

I don’t think you need raw as in `raw"𝑳𝒂𝒃𝒆𝒍 𝒊𝒏 𝒊𝒕𝒂𝒍𝒊𝒄"`

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [September 30, 2022, 4:36pm UTC](https://discourse.julialang.org/t/italic-string-in-a-plot-how/88036/4 "2022-09-30T16:36:29Z")

</div>

> [@Palli](#):
>
> I don’t think you need raw as in `raw"𝑳𝒂𝒃𝒆𝒍 𝒊𝒏 𝒊𝒕𝒂𝒍𝒊𝒄"`

I need it, otherwise my Plots gr() display looks like this:

 ![Unicode_italic_label_without_raw](https://global.discourse-cdn.com/julialang/original/3X/8/d/8d38c4a57c0901032faf1d843e07b9af1270a45e.png)

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [September 30, 2022, 4:44pm UTC](https://discourse.julialang.org/t/italic-string-in-a-plot-how/88036/5 "2022-09-30T16:44:40Z")

</div>

That’s strange (and curious why is it be needed?), since:

```julia
julia> julia> raw"𝑳𝒂𝒃𝒆𝒍 𝒊𝒏 𝒊𝒕𝒂𝒍𝒊𝒄" == "𝑳𝒂𝒃𝒆𝒍 𝒊𝒏 𝒊𝒕𝒂𝒍𝒊𝒄" # also same (String) types.
true

```

---

<div class="post-metadata">

**Author:** ![fdamore](https://avatars.discourse-cdn.com/v4/letter/f/b2d939/32.png) [@fdamore](https://discourse.julialang.org/u/fdamore)\
**Post date:** [September 30, 2022, 4:50pm UTC](https://discourse.julialang.org/t/italic-string-in-a-plot-how/88036/6 "2022-09-30T16:50:51Z")

</div>

Thanks a lot for the suggestions! I indeed solved my issue.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [September 30, 2022, 5:04pm UTC](https://discourse.julialang.org/t/italic-string-in-a-plot-how/88036/7 "2022-09-30T17:04:55Z")

</div>

> [@Palli](#):
>
> curious why is it be needed?

Honestly, I have no idea… But instead of `raw`, it would work just as well if we protected the above unicode italic string in parentheses `( )`
