NCAS-CMS / NCAS-CMS/cf-plot

Missing x axis labels for multiple line plot

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

@sadielbartholomew is already working on this.

Since Apr 15, 2025.

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

Description

For a multiple line plot created in the standard means via calling cfp.lineplot more than once wrapped inside the gopen and gclose calls, where the lines to be plotted have ranges that don't overlap, the only x axis labels shown are the ones for the data from the final call.

We should make it default behaviour that the overall lineplot axis covers the full extent of all input data, without the user having to manually specify this (if that's even possible via cfplot configuration - I am yet to have time to investigate).

MRE

Adapted from a user report (from SG). To reproduce you need data files that contain the same variable with non-overlapping ranges of data, a common example being sequential time windows as here.

MRE code
cfp.gopen()

for file in files:
    c1 = cf.read(file)
    d1 = c1.select('ncvar%zostoga')[0]
    cfp.lineplot(d1)

cfp.gclose()
Output lineplot

Note the lack of x axis labelling for all but the final file variable data input:

Image

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.