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

Skip to content

DOC: colormap manipulation tutorial update #14968

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

Merged

Conversation

ImportanceOfBeingErnest
Copy link
Member

@ImportanceOfBeingErnest ImportanceOfBeingErnest commented Aug 2, 2019

PR Summary

Update the colormap manipulation tutorial with two main points:

  • There is an important difference between ListedColormaps and LinearSegmentedColormaps which was not at all apparent from the tutorial
  • The pretty useful LinearSegmentedColormap.from_list method wasn't mentionned at all.

Link to the proposed tutorial.

PR Checklist

  • Code is Flake 8 compliant
  • Old features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant

@ImportanceOfBeingErnest ImportanceOfBeingErnest force-pushed the doc-colormap-man-update branch 2 times, most recently from 32f623a to 9e8378f Compare August 2, 2019 23:28
@jklymak
Copy link
Member

jklymak commented Aug 2, 2019

Agree w the general idea of this change because when I wrote the tutorial I didn’t understand that listed colormap behave differently. From list looks pretty useful. My main concern w this tutorial was to show how to paste existing colormaps together or make new ones from rgb arrays. If from list is a better way to do that than listed colormaps maybe modify or add new examples?

@ImportanceOfBeingErnest
Copy link
Member Author

I'm not sure if any more examples are needed, but of course feel free to suggest something. The main benefit of LinearSegmentedColormap.from_list(list) compared to LinearSegmentedColormap(dict) is just the reduced number of headaches for beginners creating that dictionary. But both aren't in competition with ListedColormap, I'd say.

@jklymak jklymak merged commit 1f003b0 into matplotlib:master Aug 9, 2019
@jklymak
Copy link
Member

jklymak commented Aug 9, 2019

Thanks, this clarifies quite a few things...

@lumberbot-app
Copy link

lumberbot-app bot commented Aug 9, 2019

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 1f003b0504ae71c0bdf47c6c1dc644d39e39dcc5
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #14968: DOC: colormap manipulation tutorial update'
  1. Push to a named branch :
git push YOURFORK v3.1.x:auto-backport-of-pr-14968-on-v3.1.x
  1. Create a PR against branch v3.1.x, I would have named this PR:

"Backport PR #14968 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.

@lumberbot-app
Copy link

lumberbot-app bot commented Aug 9, 2019

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.1-doc
$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 1f003b0504ae71c0bdf47c6c1dc644d39e39dcc5
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #14968: DOC: colormap manipulation tutorial update'
  1. Push to a named branch :
git push YOURFORK v3.1.1-doc:auto-backport-of-pr-14968-on-v3.1.1-doc
  1. Create a PR against branch v3.1.1-doc, I would have named this PR:

"Backport PR #14968 on branch v3.1.1-doc"

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.

@jklymak
Copy link
Member

jklymak commented Aug 9, 2019

This is helpful, but I don't think critical to back port unless you want to do it @ImportanceOfBeingErnest ?

@ImportanceOfBeingErnest
Copy link
Member Author

No, I guess we can leave it like this.

@ImportanceOfBeingErnest ImportanceOfBeingErnest deleted the doc-colormap-man-update branch August 9, 2019 18:04
@QuLogic QuLogic modified the milestones: v3.1-doc, v3.2.0 Aug 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants