def plt_legend_xyrel(plt, xrel, yrel, *args, **kwargs): ax = plt.gca() xlim , ylim = ax.get_xlim(), ax.get_ylim() xloc = xlim[0] + xrel * (xlim[1] - xlim[0]) yloc = ylim[0] + yrel * (ylim[1] - ylim[0]) plt.legend(*args, **kwargs, loc=[xloc, yloc])
-
-
-
Then pass xrel as ~1.05 and yrel as ~0.33; tweak to taste.
- 5 more replies
New conversation -
-
-
The cleanest is to do subplots. Side by side. I do something like that vertical, in
@stemgraphic , function small_multiples (in http://grid.py ): https://github.com/fdion/stemgraphic/blob/master/stemgraphic/grid.py … Clean export to svg too. Do your wrapper function once, then you can use it at any time.#infovizpic.twitter.com/pajmZDeyFB
-
Hrm. I like this solution, too. Decisions, decisions.
End of conversation
New conversation -
-
-
matplotlib in itself is very hard for me to deal with :D
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I concur.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
This Tweet is unavailable.
-
There's grid specs and all this stuff. It's possible (and this guy lays it out well) but it's a lot of work for an obvious feature. https://jdhao.github.io/2018/01/23/matplotlib-legend-outside-of-axes/ …
End of conversation
-
-
-
This Tweet is unavailable.
- End of conversation
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.