Prevent subplots from overlapping in 6-panel plots; Prevent colorbar labels from overlapping #260
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the companion PR to #259, in which we have implemented several fixes for the 6-panel plots (as are used to display GEOS-Chem benchmark output):
Add a new style sheet
gcpy/gcpy_plot_style
with global settings for plot titles and labels. These settings are applied with theplt.style.use()
function.Remove hardwired fontsize attributes in
compare_single_level
andcompare_zonal_mean
. We now get these values from the settings ingcpy/gcpy_plot_style
.Decrease the amount of padding space (from 0.10 to 0.02) between the plot and colorbar for
single_level
plots. This will prevent the colorbar from overlapping with the plot titles in the next row.Increase the amount of padding between the plot and colorbar (from 0.10 to 0.15) between the plot and colorbar for
zonal_mean
plots. This will prevent the zonal mean plots from overlapping onto the next row.Make sure that the colorbar min and max values (
vmin
,vmax
) are such thatvmin
is always smaller thanvmax
for dynamic-range ratio plots. This was causing an issue where colorbar plot labels were overlapping each other.For dynamic-range ratio plots, if the data lies in the range 0.999..1.001, then only create 3 colorbar ticklabels (
[vmin, 1, vmax
]). Using less ticklabels will prevent the ticklabels from overlapping.In routine
compare_zonal_mean
, add extra padding space around each subplot (and also define the left and right extents for the subplots on the page) with a call toplt.subplots_adjust()
.