# Plots: Labeling

**URL:** <https://discourse.julialang.org/t/plots-labeling/1309>\
**Category:** Visualization\
**Tags:** question\
**Created:** [January 5, 2017, 6:06pm UTC](https://discourse.julialang.org/t/plots-labeling/1309 "2017-01-05T18:06:08Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diger](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/diger/32/36786_2.png) [@Diger](https://discourse.julialang.org/u/Diger)\
**Post date:** [January 5, 2017, 6:06pm UTC](https://discourse.julialang.org/t/plots-labeling/1309/1 "2017-01-05T18:06:08Z")

</div>

In old Plots I could use sth like:  
xlabel=“\u3b7”  
which doesnt work anymore now.  
Also is it possible to increase the legend size and text?!?

---

<div class="post-metadata">

**Author:** ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)\
**Post date:** [January 5, 2017, 6:46pm UTC](https://discourse.julialang.org/t/plots-labeling/1309/2 "2017-01-05T18:46:37Z")

</div>

I don’t know, which backend you are using. With GR, you can use escape characters (e.g. `\\eta`):

```julia
using Plots
gr()
plot(randn(2),randn(2),xlabel="\\eta")

```

… or with plain GR:

```julia
using GR
plot(randn(2),randn(2),xlabel="\\eta")

```

---

<div class="post-metadata">

**Author:** ![Diger](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/diger/32/36786_2.png) [@Diger](https://discourse.julialang.org/u/Diger)\
**Post date:** [January 5, 2017, 6:50pm UTC](https://discourse.julialang.org/t/plots-labeling/1309/3 "2017-01-05T18:50:42Z")

</div>

Sorry PyPlot is my backend…

---

<div class="post-metadata">

**Author:** ![Diger](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/diger/32/36786_2.png) [@Diger](https://discourse.julialang.org/u/Diger)\
**Post date:** [January 5, 2017, 7:20pm UTC](https://discourse.julialang.org/t/plots-labeling/1309/4 "2017-01-05T19:20:23Z")

</div>

So unicode is not supported anymore?  
What about legend size? (or label size in general)

---

<div class="post-metadata">

**Author:** ![Diger](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/diger/32/36786_2.png) [@Diger](https://discourse.julialang.org/u/Diger)\
**Post date:** [January 7, 2017, 9:59pm UTC](https://discourse.julialang.org/t/plots-labeling/1309/5 "2017-01-07T21:59:03Z")

</div>

So nobody here who can help me ?  
PS: Ok I found the font stuff again.  
So whats only left is the unicode issue…

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 8, 2017, 9:49pm UTC](https://discourse.julialang.org/t/plots-labeling/1309/6 "2017-01-08T21:49:36Z")

</div>

Unic[quote=“Diger, post:4, topic:1309, full:true”]  
So unicode is not supported anymore?What about legend size? (or label size in general)  
[/quote]

Unicode support depends on Matplotlib and the fonts. Matplotlib supports Unicode labels [but its default font may or may not support the symbols you want](http://matplotlib.org/users/mathtext.html). An alternative is to use LaTeX for math symbols in the labels.

For legend size, google [legend size in Matplotlib](http://stackoverflow.com/questions/7125009/how-to-change-legend-size-with-matplotlib-pyplot) and several answers turn up. It is straightforward to translate this to PyPlot:

```nohighlight
using PyPlot
plot(rand(10))
legend(["random numbers"], prop=Dict("size"=>20))

```

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [January 10, 2017, 1:06pm UTC](https://discourse.julialang.org/t/plots-labeling/1309/7 "2017-01-10T13:06:59Z")

</div>

The Matplotlib code works in PyPlot, but not in Plots when using PyPlot as a backend. The Plots syntax for doing this is

```julia
using Plots; pyplot()
plot(rand(10), label = "random", legendfont = font(10))

```

A good trick is to do a page search for “legend” on this page: [https://juliaplots.github.io/attributes/](https://juliaplots.github.io/attributes/)

---

<div class="post-metadata">

**Author:** ![Diger](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/diger/32/36786_2.png) [@Diger](https://discourse.julialang.org/u/Diger)\
**Post date:** [January 10, 2017, 9:00pm UTC](https://discourse.julialang.org/t/plots-labeling/1309/8 "2017-01-10T21:00:00Z")

</div>

Hey, yes thx. I was using unicode since plots with pyplot as backend originally supported only unicode I think. (correct me if im wrong)  
If there is a way to use latex symbols in Plots that would help as well.

---

<div class="post-metadata">

**Author:** ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Post date:** [January 10, 2017, 9:10pm UTC](https://discourse.julialang.org/t/plots-labeling/1309/9 "2017-01-10T21:10:02Z")

</div>

There is, just `using LaTeXStrings`, then specify strings with Latex using L, i.e. `L"..."`

---

<div class="post-metadata">

**Author:** ![Diger](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/diger/32/36786_2.png) [@Diger](https://discourse.julialang.org/u/Diger)\
**Post date:** [January 10, 2017, 9:26pm UTC](https://discourse.julialang.org/t/plots-labeling/1309/10 "2017-01-10T21:26:42Z")

</div>

maybe stupid question, but what does:  
julia\> using latexstrings  
WARNING: replacing module LaTeXStrings.  
WARNING: replacing module LaTeXStrings.  
WARNING: replacing module LaTeXStrings.  
WARNING: replacing module LaTeXStrings.  
WARNING: replacing module LaTeXStrings.  
WARNING: requiring “latexstrings” in module “Main” did not define a corresponding module.  
mean  
It seems to recognize it though LaTeXStrings is really necessary? Either I would expect it not to work at all or it does, or not?

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 10, 2017, 10:34pm UTC](https://discourse.julialang.org/t/plots-labeling/1309/11 "2017-01-10T22:34:18Z")

</div>

> [@Diger](#):
>
> julia\> using latexstrings

The module name is case sensitive. You need `using LaTeXStrings`. (Tab-completion can help you to type this.)

(Are you using Julia 0.4? Julia 0.5 should be better about giving a sensible error message for mis-capitalized module names on case-insensitive filesystems like Mac and Windows: [https://github.com/JuliaLang/julia/pull/13542](https://github.com/JuliaLang/julia/pull/13542))

---

<div class="post-metadata">

**Author:** ![Diger](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/diger/32/36786_2.png) [@Diger](https://discourse.julialang.org/u/Diger)\
**Post date:** [January 11, 2017, 2:11am UTC](https://discourse.julialang.org/t/plots-labeling/1309/12 "2017-01-11T02:11:56Z")

</div>

So this is because I’m using windows that I don’t get a “proper” error?  
julia v0.5 on this pc.
