Matplotlib: align axes across different figures - matplotlib

I'm having two different figures with identical figsize which I embed in an latex ducment (picture).
How can I make that it does not missalign slightly in the way it currently is? (the right figure has larger axis)

Related

How to resize subplots in pyplot, dependent on the height of a table?

There are many ways in matplotlib.pyplot to change the size of subplots. However, they all seem to require some hand-tuning. I would like to do it in an automatic way, depending on the actual sizes of the plots.
In my case, I would like to generate a whole lot of pdf files that look something like this:
As you can see, the table in the top subplot has a lot of white space around it, so I would like to reduce the vertical size of the top subplot and make the bottom one larger, to fill up the space a bit better.
I know that I can set the sizes of subplots with GridSpec, among a bewildering array of other methods. However, the number of rows in my tables will vary from file to file, so I don't know in advance what sizes I want the subplots to be.
TL;DR: I want the first subplot to be as tall as the table (however tall that is) and the second to take up the remaining space. Is this possible in MatPlotLib?

Matplotlib: Grid is too tight for small plot

I want to make the plot smaller, so it can save some space in print. However, when I make it smaller, the grid will be too tight:
Honestly, I don't get it. Why can't matplotlib auto-detect that this image is too small that the lable should be with a bigger interval?
So, How can I make the grid more sparse, so the lables won't overlap with each other?
Additionally, the title will also collapse with the labels. I can set it manually, by plt.suptitle(title, y=1.08). So it will look better
But I'm wondering if there is anyway to do it automatically?
Note: I'm using seaborn, but I tried with pure matplotlib, same problem.

Circular panning with matplotlib

I'm looking for a way to have interactive "circular panning" with matplotlib: when
interactively moving the axes to the left or the right, I want the data
(and axes labels) to "wrap around". (An (silly) example application would
be e.g. plotting annual average temperatures, and wanting to look at
whether anything special is happening around New Year.)
Is there a simple way to achieve this?

Matplotlib scatter plot with density histograms on the sides

I don't know any way to describe this plot, but I need to do it preferably with matplotlib. If there is a name for this plot, I would love to know it.
It can be found on page 10 of this PLOS ONE paper (Figure 6): http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0093590
Basically, each section is made up of three plots. One scatter plot, and two histograms that show the density of points in each region, one for each axis.
Any help would be great. Thanks.

matplotlib, how change plot size without affecting axis label

I want to make a plot in matplotlib that is wide and short. I can manipulate the size of a plot as answered on this question.
However, the x-axis label disappears if the plot is not tall enough. I want to squeeze the plot more while keeping the axis label visible.
Is there a way to manipulate the size of the plot without getting rid of the axis label?
After you change the plot size, run tight_layout(). Note that this requires matplotlib v1.1 or newer. If you have an older version of matplotlib, you can run subplot_tool() or subplots_adjust to adjust the plot manually.