Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

trygvrad
Copy link
Contributor

@trygvrad trygvrad commented Sep 3, 2025

This PR continues the work of #28658 and #28454, #29876, aiming to close #14168. (Feature request: Bivariate colormapping)

This PR allows Colorizer and ColorizingArtist to work with MultiNorm and BivarColormap and MultivarColormap

i.e. this PR will allow:

import matplotlib.pyplot as plt
import numpy as np
import matplotlib as mpl
a = np.arange(12).reshape(3,4)
b = np.arange(12).reshape(4,3).T

norm = mpl.colors.Normalize(vmin=0, vmax=11)
col = mpl.colorizer.Colorizer(cmap='BiOrangeBlue', norm=[norm, norm])

plt.imshow(col.to_rgba((a, b)))
image

Features not included in this PR:

  • Exposes the functionality provided by MultiNorm together with BivarColormap and MultivarColormap to the plotting functions axes.imshow(...), axes.pcolor(...), and axes.pcolormesh(...)`
  • fig.colorbar() equivalents for BivarColormap and MultivarColormap
  • Examples in the docs

PR checklist

  • new and changed code is tested

@trygvrad
Copy link
Contributor Author

trygvrad commented Sep 4, 2025

Thank you for the feedback @QuLogic and apologies for my sloppy mistakes :)

improved testing for colorizer+multinorm

Apply suggestions from code review

Co-authored-by: Elliott Sales de Andrade <[email protected]>

updates based on feedback from @QuLogic
Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

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

As I mentioned on the call, I think this looks okay from a low-level point-of-view, but I am at this point uncertain as to the high-level status. I hope someone more familiar with the current state can confirm.

PS, @trygvrad if you have some time to pop in to the call, it would be good to just re-iterate the current state succinctly, as I'm not sure everyone is up-to-speed right now.

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.

Feature request: Bivariate colormapping
2 participants