Closed ericmelse closed 11 months ago
Use legend(title())
to set the title of the legend; or legend(subtitle())
or legend(note())
or whatever; i.e. use standard legend suboptions as document in -help legend_option-.
Syntax - "text"
within layout()
adds labels without symbol to the list of legend keys; of course you can use this to set a legend title, but you will be limited in terms of styling. However, you can used SMCL tags, e.g. - "{bf:my heading)"
. To generate multiline labels, type - "line 1" "line 2" ...
(i.e. simply provide multiple text elements).
Yes, Ben, thanks again. Using layout(1 - "Mobility" "Av. pers. day"))
indeed works just fine. I am so 'used' to use for multilines ""Mobility" "Av. pers. day""
that I did not expect that I could do without the doubly double quote markers.
Stata is not fully consistent here. For multiline tick labels, the outer quotes are needed. For multiline legend labels, they have to be omitted. geoplot
behaves in the same way.
Note that you should actually type `""Mobility" "Av. pers. day""'
(i.e. use "compound" double quotes) rather than ""Mobility" "Av. pers. day""
. The latter works in some situations (e.g. when defining a local) but not in others (e.g. when specifying a multiline label in xlabel()
or similar).
Dear Ben, I tried to set the title of a legend over two lines using
`" "Mobility" "Av. pers. day" "'
using:But, although
geoplot
does run, without any complaint, the result is such that a single line is used, expanding the width of the legend, like: Do you think it is possible to adjust thegeoplot
ado file as to support using multiple lines for the title of thelegend
?Furthermore, it seems that it also not possible (as far as I can understand from the help file) to set properties of the legend title text, like its color or font size (possibly also its text box margins).