Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter to set distance between legend columns #225

Open
omuelle opened this issue Aug 16, 2018 · 1 comment
Open

Parameter to set distance between legend columns #225

omuelle opened this issue Aug 16, 2018 · 1 comment

Comments

@omuelle
Copy link

omuelle commented Aug 16, 2018

The legend columns of Gesamtschweiz D12 and D12 are very close to each other, would be nice to have a parameter to increase the distance between them.

plot_legend

HomoCodens pushed a commit that referenced this issue Aug 28, 2018
Not so sure about it though.

See #225
@HomoCodens
Copy link
Collaborator

This is done by base legend. Looks like the only parameter to affect this distance is text.width which specifies the width of all legend entries in user coordinates (e.g. a value of 1 means the legends would be as wide as one year in the plot).

See the referencing commit for a version with this parameter. The best I could do was:

tsl <- generate_random_ts(4, starts = 2013, lengths = 6*12)
names(tsl) <- c("Orig", "D11", "Gesamtschweiz D12", "D12")
tsplot(tsl, theme = init_tsplot_theme(legend_col = 4, legend_text.width = 1.37))

Not so sure this is a smart addition though, finding the value involves lots of trial and error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants