Skip to content

Commit

Permalink
Allow for longer titles
Browse files Browse the repository at this point in the history
The region name is getting completely cut off in some cases.
  • Loading branch information
xylar committed Nov 4, 2024
1 parent e95af32 commit e680a6c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions mpas_analysis/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1713,6 +1713,9 @@ availableVariables = [
'units': 'm',
'mpas': ['timeMonthly_avg_dThreshMLD']}]

# allow for longer plot titles
maxTitleLength = 55

[timeSeriesArcticOceanRegions]
## options related to plotting time series of Arctic Ocean regions

Expand Down
8 changes: 6 additions & 2 deletions mpas_analysis/ocean/time_series_ocean_regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,9 @@ def run_task(self):
timeSeriesName,
f'{timeSeriesName}_{startYear:04d}-{endYear:04d}.nc')

maxTitleLength = config.getint('timeSeriesOceanRegions',
'maxTitleLength')

sectionName = self.sectionName

anomalyVars = config.getexpression(sectionName, 'anomalies')
Expand Down Expand Up @@ -1334,7 +1337,8 @@ def run_task(self):
ylabel=yLabel, movingAveragePoints=movingAveragePoints,
lineColors=lineColors, lineWidths=lineWidths,
legendText=legendText, titleFontSize=titleFontSize,
defaultFontSize=defaultFontSize)
defaultFontSize=defaultFontSize,
maxTitleLength=maxTitleLength)

# do this before the inset because otherwise it moves the inset
# and cartopy doesn't play too well with tight_layout anyway
Expand All @@ -1344,7 +1348,7 @@ def run_task(self):

savefig(outFileName, config, tight=False)

caption = f'Regional mean of {title}'
caption = f'Regional {title}'

write_image_xml(
config=config,
Expand Down

0 comments on commit e680a6c

Please sign in to comment.