NCAS-CMS / NCAS-CMS/cf-plot

ticks in color bar

Open
#80 1 comment 0 reactions 1 assignee View on GitHub

@sadielbartholomew is already working on this.

Since Oct 23, 2024.

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

Description

I have customized the levels for the color bar in my code. According to the code, the color bar is supposed to display the tick labelled: -3.5, -2.5, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2.5, and 3.5. However, the figure does not display the specified ticks on the color bar as expected. I have attached a copy of the code along with the figure. I would appreciate it if you could help me understand why this is happening and how to fix it.

r=cf.read(dwp+'praw_mon_OBS_*.nc')[0]
cmix=[-3.5,-2.5,-1.5,-1,-0.5,0,0.5,1,1.5,2.5,3.5];
cti='regression slope (mm day$^{-1}$ PW$^{-1}$)'
cfp.cscale('scale1',ncols=len(cmix)+1, white=[5,6], reverse=True)
cfp.levs(manual=cmix)
cfp.con(r,lines=False,colorbar_title=cti,colorbar_label_skip=None)

cbar_lev

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.