Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ticks in color bar #80

Open
rabiulawaldu opened this issue Oct 22, 2024 · 1 comment
Open

ticks in color bar #80

rabiulawaldu opened this issue Oct 22, 2024 · 1 comment
Assignees
Labels

Comments

@rabiulawaldu
Copy link

rabiulawaldu commented Oct 22, 2024

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

@sadielbartholomew
Copy link
Member

sadielbartholomew commented Oct 23, 2024

Thanks Rabiul for reporting this. As I said in reply to your email on this, this is a bug and your code should produce the colourbar with all ticks labelled, as you wanted, but doesn't because of the bug. I'll comment here once I make the fix - I will try to carve out time to do that this week.

@rabiulawaldu rabiulawaldu changed the title Labels in color bar ticks in color bar Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants