# Multiline title in Plots.jl

**URL:** <https://discourse.julialang.org/t/multiline-title-in-plots-jl/5977>\
**Category:** Visualization\
**Created:** [September 19, 2017, 3:45pm UTC](https://discourse.julialang.org/t/multiline-title-in-plots-jl/5977 "2017-09-19T15:45:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwsohn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mwsohn/32/2696_2.png) [@mwsohn](https://discourse.julialang.org/u/mwsohn)\
**Post date:** [September 19, 2017, 3:45pm UTC](https://discourse.julialang.org/t/multiline-title-in-plots-jl/5977/1 "2017-09-19T15:45:49Z")

</div>

Is there a way to create a plot title in multiple lines? In R, ggplot2 displays title in two lines if the title string has an embedded newline character.

Thanks

---

<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:** [September 19, 2017, 7:00pm UTC](https://discourse.julialang.org/t/multiline-title-in-plots-jl/5977/2 "2017-09-19T19:00:28Z")

</div>

e.g., `plot(rand(5), title="first line\nsecond line")` should work in `Plots`, too.

---

<div class="post-metadata">

**Author:** ![mwsohn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mwsohn/32/2696_2.png) [@mwsohn](https://discourse.julialang.org/u/mwsohn)\
**Post date:** [September 19, 2017, 11:44pm UTC](https://discourse.julialang.org/t/multiline-title-in-plots-jl/5977/3 "2017-09-19T23:44:21Z")

</div>

> [@jheinen](#):
>
> plot(rand(5), title=“first line\nsecond line”)

Thank you. I just found out that this was the backend problem. gr and pyplot support this but plotly and plotlyjs do not.

---

<div class="post-metadata">

**Author:** ![TheLateKronos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thelatekronos/32/12824_2.png) [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Post date:** [April 15, 2020, 9:58am UTC](https://discourse.julialang.org/t/multiline-title-in-plots-jl/5977/4 "2020-04-15T09:58:13Z")

</div>

From a javascript stack-overflow question i found that `<br>` inside the string that is your title should do the trick, and it works perfectly for me.

---

<div class="post-metadata">

**Author:** ![mthelm85](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mthelm85/32/224164_2.png) [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Post date:** [April 15, 2020, 2:41pm UTC](https://discourse.julialang.org/t/multiline-title-in-plots-jl/5977/5 "2020-04-15T14:41:31Z")

</div>

Interesting. I never use the plotly backend but I wonder if all HTML tags work?
