Skip to content

FIX: resolve an issue where no ticks would be drawn for a colorbar with SymLogNorm and ranging exactly from 0 to linthresh #25970

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

Merged
merged 1 commit into from
May 28, 2023

Conversation

neutrinoceros
Copy link
Contributor

@neutrinoceros neutrinoceros commented May 24, 2023

PR summary

closes #25945
I'd like to see if this breaks any existing test before I add a new one.

PR checklist

@neutrinoceros neutrinoceros force-pushed the inclusive_symlog_regions branch from aac9ad3 to 97dafb4 Compare May 24, 2023 17:31
@neutrinoceros neutrinoceros marked this pull request as ready for review May 24, 2023 17:44
@QuLogic
Copy link
Member

QuLogic commented May 24, 2023

I'd like to see if this breaks any existing test before I add a new one.

It appears that it did not break any.

@neutrinoceros
Copy link
Contributor Author

Yup, I saw that after the first run, added a test, rebased and force pushed :)

@neutrinoceros
Copy link
Contributor Author

I see that this PR is part of the First Time Contributors project with status "Status: Waiting for author. Can anyone tell me if there's anything else I should be doing ?

@rcomer
Copy link
Member

rcomer commented May 28, 2023

Sorry I should have updated the status when I switched the labels. Now done.

Copy link
Member

@rcomer rcomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m wondering if you could get the desired effect for your edge case more simply/efficiently by modifying “simple mode”. If I have understood, your data are all within the linear range if we consider that range to be inclusive of its limits.

# "simple" mode is when the range falls entirely within (-t,
# t) -- it should just display (vmin, 0, vmax)
if -linthresh < vmin < vmax < linthresh:
# only the linear range is present
return [vmin, vmax]

@neutrinoceros
Copy link
Contributor Author

@rcomer indeed, I didn't consider that but it does what I wanted and more. I updated the branch with your suggestion, thanks a lot !

@neutrinoceros neutrinoceros force-pushed the inclusive_symlog_regions branch from d40df8b to d385da6 Compare May 28, 2023 18:48
…th SymLogNorm and ranging exactly from 0 to linthresh

Co-authored-by: Ruth Comer <10599679+rcomer@users.noreply.github.com>
@timhoffm timhoffm added this to the v3.8.0 milestone May 28, 2023
@timhoffm timhoffm merged commit 1d1b48b into matplotlib:main May 28, 2023
@timhoffm
Copy link
Member

Thanks, and congratulations on your first contribution to Matplotlib! We'd be happy to see you back.

@neutrinoceros neutrinoceros deleted the inclusive_symlog_regions branch May 28, 2023 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

[Bug]: (edge case) no ticks are drawn in colorbars with SymLogNorm
4 participants