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

Added clim support to tripcolor #22734

Merged
merged 1 commit into from
Mar 31, 2022

Conversation

andrew-fennell
Copy link
Contributor

@andrew-fennell andrew-fennell commented Mar 30, 2022

PR Summary

tripcolor was ignoring clim input.

Added parameters to collection instantiations in tripcolor to ensure that all parameters are being handled properly (including kwargs).

Closes #22726

Example code:

from pylab import *

x, y, z = np.random.rand(100), np.random.rand(100), np.random.rand(100)

tripcolor(x, y, z, clim=(0.25, 0.75))
colorbar()
show()

Incorrect output

image

Correct output

image

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

@andrew-fennell
Copy link
Contributor Author

I don't think randomness is encouraged in testing, but I am not very familiar with how to test some components.

If anyone has any advice or suggestions, I would appreciate it!

lib/matplotlib/tests/test_triangulation.py Outdated Show resolved Hide resolved
lib/matplotlib/tri/tripcolor.py Outdated Show resolved Hide resolved
@andrew-fennell andrew-fennell force-pushed the tripcolor-clim-support branch 3 times, most recently from d6d0910 to 2e1033a Compare March 30, 2022 21:38
Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

Modulo one minor indentation issue.

lib/matplotlib/tri/tripcolor.py Outdated Show resolved Hide resolved
@jklymak
Copy link
Member

jklymak commented Mar 31, 2022

I don't think randomness is encouraged in testing,

You've added a seed, so it is no longer "random"!

@jklymak jklymak added this to the v3.6.0 milestone Mar 31, 2022
@jklymak jklymak merged commit ee5d9c4 into matplotlib:main Mar 31, 2022
@jklymak
Copy link
Member

jklymak commented Mar 31, 2022

Thanks @andrew-fennell !

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.

[Bug]: tripcolor ignores clim
3 participants