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

New feature for symmetic colormaps on images with negative values #697

Closed
eugenioLR opened this issue Feb 22, 2024 · 2 comments · Fixed by #698
Closed

New feature for symmetic colormaps on images with negative values #697

eugenioLR opened this issue Feb 22, 2024 · 2 comments · Fixed by #698

Comments

@eugenioLR
Copy link
Contributor

eugenioLR commented Feb 22, 2024

I have been using this library a lot and one small inconvenience i find all the time is when i want to visualize images with positive and negative values, where i use a color map like "seismic" expecting to find positive values in red and negative values in blue, but the range of values detected don't align.

To put a practical example, here i'm trying to visualize a covariance matrix.

Using the imgplot indicating only the color map i get the following image:
isns.imgplot(cov, cmap="seismic")
image

To fix this, i have to specify the range of values i want to show

vmin = -np.abs(cov).max()
vmax = np.abs(cov).max()
isns.imgplot(cov, cmap="seismic", vmin=vmin, vmax=vmax)

image

It's not that much of an issue, but it gets a bit more cumbersome when I'm showing a grid of images.

It could be a good idea to add a flag to imgplot and other functions to handle this type of images.

@eugenioLR
Copy link
Contributor Author

I forgot to add that if this seems useful i can implement it myself.

@SarthakJariwala
Copy link
Owner

Yeah, I agree with what your suggesting - It would be useful to support it without explicitly setting vmin and vmax.

Something similar to robust=True flag. Maybe diverging=True...? Other name suggestions?

PRs are definitely welcome! Feel free to take a crack at it.

@SarthakJariwala SarthakJariwala linked a pull request Feb 27, 2024 that will close this issue
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 a pull request may close this issue.

2 participants