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

Skip to content

Colorbars need tests... #16398

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

Open
jklymak opened this issue Feb 3, 2020 · 2 comments
Open

Colorbars need tests... #16398

jklymak opened this issue Feb 3, 2020 · 2 comments
Labels
keep Items to be ignored by the “Stale” Github Action topic: color/colorbar topic: testing

Comments

@jklymak
Copy link
Member

jklymak commented Feb 3, 2020

Follow up to #16280, we need tests for colorbars. i.e.

@image_comparison(
     baseline_images=['colorbar_norms'], extensions=['png'])
 def test_cbar_norms():
     # Test colormaps with different norms
     norms = [mcolors.Normalize(vmin=-1, vmax=2),
              mcolors.BoundaryNorm(boundaries=[-1, 0, 1], ncolors=4),
              mcolors.LogNorm(vmin=1, vmax=1e4),
              mcolors.PowerNorm(gamma=0.2, vmin=0.1, vmax=0.6),
              mcolors.SymLogNorm(1, vmin=-10, vmax=10),
              mcolors.TwoSlopeNorm(1, vmin=0, vmax=2)]
     fig, axs = plt.subplots(ncols=len(norms), constrained_layout=True)
     for ax, norm in zip(axs, norms):
         fig.colorbar(cm.ScalarMappable(norm=norm, cmap='viridis'), cax=ax, extend='both')

but we can't do them yet because SymLogNorm (for instance) is not quite correct yet...

See also #16392, #16286 where this test originally came from...

@github-actions
Copy link

github-actions bot commented Jul 7, 2023

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Jul 7, 2023
@jklymak
Copy link
Member Author

jklymak commented Jul 7, 2023

This probably should still be done

@jklymak jklymak added keep Items to be ignored by the “Stale” Github Action and removed status: inactive Marked by the “Stale” Github Action labels Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep Items to be ignored by the “Stale” Github Action topic: color/colorbar topic: testing
Projects
None yet
Development

No branches or pull requests

1 participant