NCAS-CMS / NCAS-CMS/cf-plot

Support overall figure title with subplots via `gpos` argument

Open
#79 0 comments 0 reactions 1 assignee View on GitHub

@sadielbartholomew is already working on this.

Since Oct 11, 2024.

enhancement
Dominant language
Python
Stars
21
Forks
11
Avg merge
7h 11m
Merged PRs (30d)
1

Description

The rows and columns keyword arguments to gopen along with the gpos function allows one to create multiple subplot plots on one figure, but there is no built in-way to provide an overall title for the figure, to cover multiple plots.

We should support a simple, native way to add an overall title to the subplots. My suggestion is to allow this by providing a new keyword argument, overall_title or figure_title or similar, with a larger default font size that is configurable by another new keyword argument such as overalltitlefontsize.

Note at present, the only way to get an overall title is to defer to pyplot and use a suptitle (super title I believe this stands for), like so:

cfp.gopen(rows=3, columns=3)
plt.suptitle(<title>, fontsize=<fontsize>, <other args>)
...
cfp.gclose()

which is currently used for the second plot in the 12th documentation recipe as well as multiple new recipes in PR form, so as part of completing this we should update the recipes to use the new cf-plot built-in means to add the overall title.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.