# Gadfly Title Size

**URL:** <https://discourse.julialang.org/t/gadfly-title-size/61168>\
**Category:** Visualization\
**Tags:** question, gadfly\
**Created:** [May 14, 2021, 3:38pm UTC](https://discourse.julialang.org/t/gadfly-title-size/61168 "2021-05-14T15:38:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![white-c](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/white-c/32/16410_2.png) [@white-c](https://discourse.julialang.org/u/white-c)\
**Post date:** [May 14, 2021, 3:38pm UTC](https://discourse.julialang.org/t/gadfly-title-size/61168/1 "2021-05-14T15:38:03Z")

</div>

I want to have a different font size for a Gadfly `Guide.title()` versus `Guide.xlabel()`. Setting `major_label_font_size` affects both. How do I control the title size separately?

---

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [May 14, 2021, 5:32pm UTC](https://discourse.julialang.org/t/gadfly-title-size/61168/2 "2021-05-14T17:32:01Z")

</div>

Maybe, you can send in a PR to extend [https://github.com/GiovineItalia/Compose.jl/blob/da671cd35805bfbd9dc7a433830b4a8d608fe93a/src/fontfallback.jl#L171-L183](https://github.com/GiovineItalia/Compose.jl/blob/da671cd35805bfbd9dc7a433830b4a8d608fe93a/src/fontfallback.jl#L171-L183) to include `<h1>, <h2>, <h3>` where these tags set `font-size` to something like 200%, 150% and 120%. Note that I’m not a maintainer, so it might be that the maintainers don’t agree with this plan.

For example, currently `Guide.title("T<sub>i</sub><sup>2</sup>")` gives

![image](https://global.discourse-cdn.com/julialang/original/3X/a/a/aaf842fb90aaa7af13c2ae1f0e1f533e8bcd373b.png)

---

<div class="post-metadata">

**Author:** ![white-c](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/white-c/32/16410_2.png) [@white-c](https://discourse.julialang.org/u/white-c)\
**Post date:** [May 14, 2021, 11:58pm UTC](https://discourse.julialang.org/t/gadfly-title-size/61168/3 "2021-05-14T23:58:43Z")

</div>

It looks like your HTML tags resulted in the superscript being attached to the subscript. Is that what those tags should produce?

---

<div class="post-metadata">

**Author:** ![Mattriks](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mattriks/32/351_2.png) [@Mattriks](https://discourse.julialang.org/u/Mattriks)\
**Post date:** [May 15, 2021, 3:39am UTC](https://discourse.julialang.org/t/gadfly-title-size/61168/4 "2021-05-15T03:39:42Z")

</div>

Gadfly has a helper function `title`. It was developed for stacked plots (`?title`), but works on any rendered plot:

```julia
using Compose, Gadfly
p = plot(x=1:5, y=rand(5), Geom.point)
p1 = title(render(p), "My awesome plot", Compose.fontsize(24pt))

```

Future development on this point is discussed in [Fine grained theme settings · Issue #1458 · GiovineItalia/Gadfly.jl · GitHub](https://github.com/GiovineItalia/Gadfly.jl/issues/1458).

---

<div class="post-metadata">

**Author:** ![white-c](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/white-c/32/16410_2.png) [@white-c](https://discourse.julialang.org/u/white-c)\
**Post date:** [May 15, 2021, 4:30am UTC](https://discourse.julialang.org/t/gadfly-title-size/61168/5 "2021-05-15T04:30:29Z")

</div>

Thanks that does what I needed.
