ggplot: legend: improve showlegend and fix 'x' position

This PR is as split of legend titles to ease its reviewing.

Summary:
- Add condition so when legends are shown is closer to ggplot's
- Fix legend position of 'x': change 100 to 1 (limit is 1);
- Some code cleaning.

Example, see first: http://www.cookbook-r.com/Graphs/Titles_%28ggplot2%29/
Before: https://plot.ly/~pdespouy/2096/weight-vs-group/
After: https://plot.ly/~pdespouy/2097/weight-vs-group/

Image diffs can be seen here: ecc8cc3

cc/ @mkcor