Skip to content

Conversation

@cvanelteren
Copy link
Collaborator

Addresses #313

Not sure if this is the best way to approach this. The issue in #313 is caused by the vcenter being 0 where the data is clearly not zerod around that value. I would prefer to push this code in the parsing of cmap directly inferring it from the input data when set, but the current colorbar handling is still rather opague to me. I wanted to move it to a separate class and clean it up but there seems that task proven to be more challenging than I initially thought. Open for feedback to fix this is another way.

Basically, the vcenter is now inferred if vmin and vmax is set, otherwise defaults to normal default vcenter = 0.

@codecov
Copy link

codecov bot commented Aug 7, 2025

Codecov Report

❌ Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ultraplot/axes/plot.py 66.66% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@cvanelteren cvanelteren requested review from beckermr and Copilot August 7, 2025 10:52

This comment was marked as resolved.

@cvanelteren
Copy link
Collaborator Author

Note that vcenter is the data value for which the space is exactly half. The PR currently infers it only if fair is set which treats each half as linearly similar. For non-linearly spaced spaces, vcenter may not be the mere average.

@cvanelteren cvanelteren marked this pull request as draft August 7, 2025 10:59
@cvanelteren
Copy link
Collaborator Author

Actually I move it to _parse_cmap cuz i don't like how it is handled here. Sorry for the ping @beckermr

@cvanelteren cvanelteren marked this pull request as ready for review August 7, 2025 11:16
@cvanelteren cvanelteren merged commit 644e1d0 into Ultraplot:main Aug 7, 2025
25 checks passed
cvanelteren added a commit that referenced this pull request Aug 14, 2025
…314)

* add unittest

* add to parse cmap

* replace unittest with becker's example

* restore init of diverging norm

* fix import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants