Hi everyone. I'm a newbye to matplotlib, so excuse my naive questions. I have a large experience with gnuplot and asymptote, and I only recently started to experiment with matplotlib.
Some background: I'm trying to use matplotlib mostly for complex plots with a lot of data. Gnuplot is usually fine, but I ended up too often producing huge batch scripts consisting of overlarge plot command sequences and pre-processed input files. Asymptote is awesome, but reading data is a mayor pita. As a result, I mostly use gnuplot interactively, and asymptote when I need to plot functions. Both packages are generally excellent, they have good support of multiple plots and usually never require manual placement of figure elements.
So far my experience with matplotlib is that a lot of manual placement seem to be required when coming down to multiple plots and legends.
I have a large figure, consisting of several dense plots.
I'm trying to plot the legend outside of the plots, but I find it bothersome how difficult it is to place the legend outside the plot.
With gnuplot, it's as simple as:
set key outside top right
This also works perfectly fine with 'multiplot' (gnuplot automatic multiple plot layout).
With matplotlib, I have to do the following:
legend(bbox_to_anchor=(1, 1 + ?), loc=2)
but how do I calculate the vertical location? Do I have to go at random to align the legend to the plot axis? It also breaks wonderfully with multiple plots, since plot(xyz) seems to consider only the axis and nothing more.
Can't we just have:
please? The vast majority of plots I do are too dense to have a legend inside the plot.
Also, related to my previous message (savefig bbox_inches='tight' does not consider suptitle), the legend is not considered when constructing a 'tight' boundary box.
It seems to me that the legend is another obvious element that should be taken into account without resorting to bbox_extra_artists.