Skip to content

Support RGBA for quadmesh mode of pcolorfast. - #13986

Merged
efiring merged 1 commit into
matplotlib:masterfrom
anntzer:pcolorfast-quadmesh-rgba
Apr 23, 2019
Merged

efiring merged 1 commit into
matplotlib:masterfrom
anntzer:pcolorfast-quadmesh-rgba

Conversation

@anntzer

@anntzer anntzer commented Apr 18, 2019

Copy link
Copy Markdown
Contributor

PR Summary

As pointed out by @ImportanceOfBeingErnest in https://stackoverflow.com/questions/49621655/rgb-polar-plot-in-python/49630831#49630831, pcolormesh does support (in a slightly awkward way) RGBA input, and thus pcolorfast can also support it easily.

Suggesting to still smuggle this in 3.1, as it's a natural extension over #8690...

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer added this to the v3.1.0 milestone Apr 18, 2019
@anntzer
anntzer force-pushed the pcolorfast-quadmesh-rgba branch from 66d1605 to 640258d Compare April 18, 2019 22:35
@efiring

efiring commented Apr 20, 2019

Copy link
Copy Markdown
Member

I like this and will give it a positive review ASAP, but I request that you first add a fix for a relevant documentation error that was introduced in 3e14dd2. Specifically, in the Quadmesh case, the shapes of X and Y must be (M+1, N+1), where C.shape is (M, N). Also remove the reference to pcolormesh, which is misleading in this context; the shape rules are more strict for pcolorfast than for pcolormesh.

@anntzer
anntzer force-pushed the pcolorfast-quadmesh-rgba branch from 640258d to 793b583 Compare April 23, 2019 06:58
@anntzer

anntzer commented Apr 23, 2019

Copy link
Copy Markdown
Contributor Author

edited the docstring accordingly.

@anntzer
anntzer force-pushed the pcolorfast-quadmesh-rgba branch from 793b583 to 7644743 Compare April 23, 2019 07:17
ret.set_clim(vmin, vmax)
else:
elif np.ndim(C) == 2:
ret.autoscale_None()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would add a comment

# np.dim(C) == 3 has explicit RGB(A) values and does not need scaling.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure, done

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Have you pushed? I don't see a comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

duh, put it at the wrong line; fixed.

@anntzer
anntzer force-pushed the pcolorfast-quadmesh-rgba branch from 7644743 to 8d0c12f Compare April 23, 2019 11:56
@anntzer
anntzer force-pushed the pcolorfast-quadmesh-rgba branch from 8d0c12f to 4903d36 Compare April 23, 2019 13:07
@efiring
efiring merged commit c05537d into matplotlib:master Apr 23, 2019
@lumberbot-app

lumberbot-app Bot commented Apr 23, 2019

Copy link
Copy Markdown

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout v3.1.x
$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 c05537d310bfb2284f28766aec4501900de207e7
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #13986: Support RGBA for quadmesh mode of pcolorfast.'
  1. Push to a named branch :
git push YOURFORK v3.1.x:auto-backport-of-pr-13986-on-v3.1.x
  1. Create a PR against branch v3.1.x, I would have named this PR:

"Backport PR #13986 on branch v3.1.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to suggest an improvement.

@anntzer
anntzer deleted the pcolorfast-quadmesh-rgba branch April 23, 2019 18:05
@QuLogic

QuLogic commented Apr 24, 2019

Copy link
Copy Markdown
Member

Well, the rc is out, so I'm guessing we aren't going to slip this into 3.1.0.

@QuLogic QuLogic modified the milestones: v3.1.0, v3.2.0 Apr 24, 2019
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request May 18, 2019
Resolved all conflicts in favor of the master branch except for the
changes to doc/api/prev_api_changes/api_changes_3.1.0.rst

pcolorfast was updating to take RGB(A) in some cases in PR matplotlib#8690 /
94b0bca that was backported to v3.1.x
via matplotlib#13709 / afc4e61 .  However, the
functionality was further extended in matplotlib#13986 /
c05537d which was not backported.
When merging v3.1.x into master special care had to be taken to not
pull the removed code back into master.
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.

4 participants