Closed thjsal closed 1 year ago
Seems like there as been changes in GetDist which explain the different behavior now. Here is link to the issue I raised there: https://github.com/cmbant/getdist/issues/102
As mentioned in the (now closed) GetDist issue linked above, the tight layout can be achieved by decreasing the font size or rotating the tick labels.
But if don't want to do that, one can still get tight layout by modifying GetDist (getdist/getdist/plots.py) by replacing line
self.gridspec.tight_layout(self.fig, h_pad=self._share_kwargs.get('h_pad'), w_pad=self._share_kwargs.get('w_pad'), rect=rect)
with
plt.tight_layout(h_pad=self._share_kwargs.get('h_pad'), w_pad=self._share_kwargs.get('w_pad'), rect=rect)
.
Since making this change did not get support from GetDist, I consider this issue closed.
The tight layout is not working with large corner plots for the Python3 version of X-PSI. The reason for that is not clear to me. This means that for large corner plots vertical white spaces appear between the subplots unless rotating the x-axis tick labels by 90 degrees using
axis_tick_x_rotation
option. An example of this is the first corner plot in the Post-processing tutorial: https://xpsi-group.github.io/xpsi/Post-processing.html. This did not happen with the older GetDist and X-PSI versions used with Python2.I have tried to fix the problem by adding
plt.tight_layout()
after calling the CornerPlotter, but that does not seem to help (it just gives a warning that a tight layout is not possible). In addition, passingtight_layout=True
keyword argument for GetDist does not affect either. In this case, GetDist documentation (https://getdist.readthedocs.io/en/latest/plots.html) suggests tryingconstrained_layout=True
argument instead. That does not remove vertical white spaces, and it even creates horizontal white spaces between the subplots instead.