[yt-dev] Issue #831: 'kamae' colormap raises IndexError in matplotlib (yt_analysis/yt)

Kacper Kowalik issues-reply at bitbucket.org
Tue Apr 22 08:38:10 PDT 2014


New issue 831: 'kamae' colormap raises IndexError in matplotlib
https://bitbucket.org/yt_analysis/yt/issue/831/kamae-colormap-raises-indexerror-in

Kacper Kowalik:

Following script:


```
#!python

from yt.mods import load, SlicePlot

pf = load("IsolatedGalaxy/galaxy0030/galaxy0030")
slc = SlicePlot(pf, 2, "density")
slc.set_cmap("density", "kamae")
slc.save()
```

yields:


```
#!text

Traceback (most recent call last):
  File "ala.py", line 8, in <module>
    slc.save()
  File "/home/xarth/codes/yt-my/yt/visualization/plot_container.py", line 443, in save
    names.append(v.save(n, mpl_kwargs))
  File "/home/xarth/codes/yt-my/yt/visualization/base_plot_types.py", line 84, in save
    canvas.print_figure(name, **mpl_kwargs)
  File "/usr/lib64/python2.7/site-packages/matplotlib/backend_bases.py", line 2220, in print_figure
    **kwargs)
  File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 505, in print_png
    FigureCanvasAgg.draw(self)
  File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_agg.py", line 451, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib64/python2.7/site-packages/matplotlib/artist.py", line 54, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 1034, in draw
    func(*args)
  File "/usr/lib64/python2.7/site-packages/matplotlib/artist.py", line 54, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/matplotlib/axes.py", line 2086, in draw
    a.draw(renderer)
  File "/usr/lib64/python2.7/site-packages/matplotlib/artist.py", line 54, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/matplotlib/image.py", line 364, in draw
    im = self.make_image(renderer.get_image_magnification())
  File "/usr/lib64/python2.7/site-packages/matplotlib/image.py", line 588, in make_image
    transformed_viewLim)
  File "/usr/lib64/python2.7/site-packages/matplotlib/image.py", line 204, in _get_unsampled_image
    x = self.to_rgba(self._A, bytes=False)
  File "/usr/lib64/python2.7/site-packages/matplotlib/cm.py", line 261, in to_rgba
    x = self.cmap(x, alpha=alpha, bytes=bytes)
  File "/usr/lib64/python2.7/site-packages/matplotlib/colors.py", line 542, in __call__
    self._init()
  File "/usr/lib64/python2.7/site-packages/matplotlib/colors.py", line 724, in _init
    self.N, self._segmentdata['red'], self._gamma)
  File "/usr/lib64/python2.7/site-packages/matplotlib/colors.py", line 449, in makeMappingArray
    if len(shape) != 2 and shape[1] != 3:
IndexError: tuple index out of range

```

with

```
#!text

$ yt instinfo

yt module located at:
    /home/xarth/codes/yt-my

The current version and changeset for the code is:

---
Version = 3.0-dev
Changeset = 71196d4289bf
---

This installation CAN be automatically updated.
Could not determine when yt stack was last updated.
$ python -c 'import matplotlib; print matplotlib.__version__'
1.3.0
```





More information about the yt-dev mailing list