Open nmalkin opened 2 years ago
The positioning of the legend is fairly straightforward to control:
axes = plot_likert.plot_likert(df, scale)
legend = axes.get_legend()
legend.set_bbox_to_anchor((1.5, 1)) # or whatever
This might be a good thing to add to the user guide. (PRs welcome until I get to it myself).
Another option might be to allow passing in additional arguments for the legend, as is done, for example, in 533b5700ec72b5e36c7713afb27d175512113736 in a fork. I'm reluctant to add features that don't seem strictly necessary, but I'm curious if there's a lot of demand for this.
(This is all side-stepping the question of why the legend's placement is off in the first place. I don't know the answer to that, but I'm inclined to keep the default behavior rather than trying to second-guess matplotlib.)
I think this should be added to the examples as well, being able to control the position of the legend is super useful for generating plots in publications with page limits / other space restrictions.
Originally posted by @hbxbgrw7913 in https://github.com/nmalkin/plot-likert/discussions/37#discussioncomment-3812488