Full support for string cmaps.#951
Merged
pelson merged 2 commits intomatplotlib:masterfrom Jun 21, 2012
Merged
Conversation
Member
Author
There was a problem hiding this comment.
Note the change in scope. This fixes the obtuse message:
>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> plt.imshow(np.arange(12).reshape(3, 4), cmap='hots')
<matplotlib.image.AxesImage object at 0x25265d0>
>>> plt.show()
Traceback (most recent call last):
File "matplotlib/backends/backend_gtk.py", line 423, in expose_event
self._render_figure(self._pixmap, w, h)
File "matplotlib/backends/backend_gtkagg.py", line 75, in _render_figure
FigureCanvasAgg.draw(self)
File "matplotlib/backends/backend_agg.py", line 433, in draw
self.figure.draw(self.renderer)
File "matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "matplotlib/figure.py", line 925, in draw
func(*args)
File "matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "matplotlib/axes.py", line 1998, in draw
a.draw(renderer)
File "matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "matplotlib/image.py", line 359, in draw
im = self.make_image(renderer.get_image_magnification())
File "matplotlib/image.py", line 579, in make_image
transformed_viewLim)
File "matplotlib/image.py", line 202, in _get_unsampled_image
x = self.to_rgba(self._A, bytes=False)
File "matplotlib/cm.py", line 241, in to_rgba
x = self.cmap(x, alpha=alpha, bytes=bytes)
TypeError: 'NoneType' object is not callable
Member
Author
|
This is quite a trivial change, so unless anyone objects, I will merge in 24hrs. |
Member
|
On 06/20/2012 12:38 AM, Phil Elson wrote:
All good. Eric
|
pelson
added a commit
that referenced
this pull request
Jun 21, 2012
Contour and streamplot support for cmaps passed by name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR allows users to always specify names of registered cmaps where cmap is an argument to an axes or figure method.