-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
adding from_list to custom cmap tutorial #6662
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
Conversation
btw, let me know if you want me to change the other objects in this tutorial so they're object-based instead of |
colors = [(1, 0, 0), (0, 1, 0), (0, 0, 1)] # R -> G -> B | ||
n_bins = [2, 5, 10, 100] # Discretizes the interpolation into bins | ||
cmap_name = 'my_list' | ||
f, axs = plt.subplots(1, 4, figsize=(10, 5)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the convention is as follow:
fig, axes = plt.subplots()
Maybe @mdboom or @tacaswell can confirm?
In any case, we should be as consistent as possible on the whole file. There are other places in this example that don't use the object oriented interface: do you mind editing those as well (for example l.170 to 182).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool - yep I can edit those as well (see my latest comment on the main thread).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cax
kwarg takes an Axes that you have made yourself to hold the colorbar; I think what you want is the ax
kwarg, which takes the parent Axes from which space for the colorbar will be taken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hooray that worked!
On Tue, Jun 28, 2016 at 10:27 AM, Eric Firing notifications@github.com
wrote:
In examples/pylab_examples/custom_cmap.py
#6662 (comment):+colors = [(1, 0, 0), (0, 1, 0), (0, 0, 1)] # R -> G -> B
+n_bins = [2, 5, 10, 100] # Discretizes the interpolation into bins
+cmap_name = 'my_list'
+f, axs = plt.subplots(1, 4, figsize=(10, 5))The cax kwarg takes an Axes that you have made yourself to hold the
colorbar; I think what you want is the ax kwarg, which takes the parent
Axes from which space for the colorbar will be taken.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/matplotlib/matplotlib/pull/6662/files/b380fd7bae75b8dc9d12d24977f177175674f317#r68802996,
or mute the thread
https://github.com/notifications/unsubscribe/ABwSHWIznsZA2Ju7IYpNa1D0U5yXuIR4ks5qQVl6gaJpZM4JAULd
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(thx)
On Tue, Jun 28, 2016 at 10:29 AM, Chris Holdgraf choldgraf@gmail.com
wrote:
hooray that worked!
On Tue, Jun 28, 2016 at 10:27 AM, Eric Firing notifications@github.com
wrote:In examples/pylab_examples/custom_cmap.py
#6662 (comment)
:+colors = [(1, 0, 0), (0, 1, 0), (0, 0, 1)] # R -> G -> B
+n_bins = [2, 5, 10, 100] # Discretizes the interpolation into bins
+cmap_name = 'my_list'
+f, axs = plt.subplots(1, 4, figsize=(10, 5))The cax kwarg takes an Axes that you have made yourself to hold the
colorbar; I think what you want is the ax kwarg, which takes the parent
Axes from which space for the colorbar will be taken.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/matplotlib/matplotlib/pull/6662/files/b380fd7bae75b8dc9d12d24977f177175674f317#r68802996,
or mute the thread
https://github.com/notifications/unsubscribe/ABwSHWIznsZA2Ju7IYpNa1D0U5yXuIR4ks5qQVl6gaJpZM4JAULd
.
Hi Chris, Thanks for the patch! I think the additional documentation is great. Thanks, |
I'll try building sphinx after updating the commit. Can you give a quick reminder on how to do this, it's been a while since I've built docs |
b380fd7
to
963ded8
Compare
Actually it's just |
Use the |
@efiring this is IMO a bit annoying. If we used the "newer" build system of sphinx, that would not happen. I can easily create a PR with the new Makefile (and make.bat) files. Would that be of any interest to the project? |
That warning is caused by Sphinx 1.4x being stricter And already fixed on current master. The easiest way to suppress it rather than allowing it is to either rebase on current master or downgrade Sphinx to 1.3x |
@NelleV Setting warningsaserrors as the default is done very much on purpose and as the person that fixed more than 800 Sphinx warnings before that became possible I would be very hard to convince to change this. Travis builds the docs every a branch is pushed with warnings as errors and it works just fine |
This is the PR that fixes it #6238 which was merged a few days after Sphinx 1.4 was released |
@jenshnielsen I'm running the latest matplotlib, and I still have this problem while using make.py. |
Sorry I misunderstood I thought you wanted to change to Makefiles to get rid of the warningsaserrors It's puzzling that you still see this error since travis builds without that warning and has done for a long time |
In any case, the make.py file is antiquated. The new version of the matplotlib build would not have required the patch from #6238 . The problem with make.py is that it does not guet updated with the library, but it should. Hence the move from generating the make.py to a makefile that calls itself the sphinx-build executable. |
Im happy to convert to Makefiles as long as we build the docs with warningsaserrors |
ah thanks for that - sphinx is building now w/ the flag...gonna take a bit of time for it to finish, I'll update when that's done |
@jenshnielsen I don't think it makes sense to activate the -W option if we have to disable it to have the documentation build… It is what is happening right now. It doesn't bring any advantages, and has the strong disaventages of increasing the difficulty of building the documentation, and thus of contributing to matplotlib. |
It at the very least need to be the enabled on Travis as I said I had to fix more than 800 warnings including very significant wrongly rendered pages that went unnoticed for years. Since we made this the default on travis we have caught a large number of pr's with invalid RST syntax which would have been unnoticed and only fixed years later. We can change the default and make this optional again i.e. revert 1af4ca0 |
That looks good to me. I don't really understand why the appveyor build fails, and I don't think it has anything to do with your PR. Thanks for the patch! |
Yeah I couldn't figure that one out either...but didn't seem related. Let Chris On Tue, Jun 28, 2016 at 10:55 PM, Nelle Varoquaux notifications@github.com
|
appveyor have some issues at the moment #6520 is work towards resolving it |
DOC: adding from_list to custom cmap tutorial
Thanks! backported to v1.5.x as 9e5b18a |
🎉 🎉 🎉 |
This PR adds a bit more explanation to the docstring for this tutorial, rearranges the data creation to be at the beginning, and adds a small section that shows how to create a colormap from a list of RGB tuples.
@NelleV WDYT?