# Plots.jl treatment of strings/labels

**URL:** https://discourse.julialang.org/t/plots-jl-treatment-of-strings-labels/11580
**Category:** General Usage
**Tags:** plotting
**Created:** [June 11, 2018, 10:07am UTC](https://discourse.julialang.org/t/plots-jl-treatment-of-strings-labels/11580 "2018-06-11T10:07:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [June 11, 2018, 10:07am UTC](https://discourse.julialang.org/t/plots-jl-treatment-of-strings-labels/11580/1 "2018-06-11T10:07:06Z")

</div>

Currently trying to remove PyPlot from some of my old code and trying to move to Plots.jl, and while I’m generally positively surprised about how quickly I’ve been able to convert some basic plots, some things still stump me.

The first issue I would assume is due to my own inability to properly read the documentation: I can’t seem to be able to figure out how to adjust the font of axis labels - on the [attributes](http://docs.juliaplots.org/latest/attributes/#axis-and-xaxisyaxiszaxis) page I can find fonts for legends, axis ticks, titles etc but not for the axis labels?

A second related question is how strings are handled for different backends. Consider the following example:

```julia
using Plots

plotlyjs()

plot(Plots.fakedata(100), xlabel="This needs a<br>linebreak")

gr()

plot(Plots.fakedata(100), xlabel="This needs a<br>linebreak")

```

Given the different formatting of strings in the two backends (GR using “regular” string formatting, while PlotlyJS relies on html tags), the correct display of the plot depends on which backend the user has installed.

What is the accepted way of solving this in Plots.jl? I could think of simply setting the backend explicitly in the code, or checking for the active backend and then constructing the string appropriately, but both don’t seem optimal to me!

---

<div class="post-metadata">

### Author: ![piever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piever/32/1815_2.png) [@piever](https://discourse.julialang.org/u/piever)
#### Post date: [June 11, 2018, 11:01am UTC](https://discourse.julialang.org/t/plots-jl-treatment-of-strings-labels/11580/2 "2018-06-11T11:01:47Z")

</div>

Concerning the axis label, the correct attribute is `guidefont` (or `xguidefont` for only `x` axis). It is documented in the table but admittedly a bit hard to find unless you know what to look for, it’d be interesting to hear if there are new ideas on how to improve that documentation page.

Concerning backends, while superficially they are interchangeable, digging deeper they are not. Especially if you do a lot of fine tuning to the plot, changing backend could require some adjusting. I personally simply chose one backend (GR) and stuck with it. GR is the default so you don’t need to do anything to set it.
