FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Axes3D scatter crashes without alpha keyword · Issue #6698 · matplotlib/matplotlib · GitHub

Repository navigation

Axes3D scatter crashes without alpha keyword #6698

Description

version: 2.0.0b1+1773.g3590ce2
backend: gtkagg inside an ipython session

code snippet is:

from mpl_toolkits.mplot3d import Axes3D
clf()
ax = subplot(111, projection='3d')
l1 = ax.scatter([0,0.01,1],[0,0.01,1],[0,0.01,1], c='b')
# asc is a 93,3 numpy array of float128
# if required I can supply this data. 
Q = zip(*asc)
l2 = ax.scatter(Q[0],Q[1],Q[2], c='b')
#l2.set_alpha(0.5)
draw()

if alpha is not set for l2, then we crash. Visually there's lots of overlap in the l2 marker points. Notably l1 doesn't crash even without an alpha parameter, even though I do see overlap in the two close marker points.

Traceback (most recent call last):
  File "/Users/mcj/lib/python2.7/site-packages/matplotlib-2.0.0b1+1773.g3590ce2-py2.7-macosx-10.11-x86_64.egg/matplotlib/backends/backend_gtk.py", line 443, in expose_event
    self._render_figure(self._pixmap, w, h)
  File "/Users/mcj/lib/python2.7/site-packages/matplotlib-2.0.0b1+1773.g3590ce2-py2.7-macosx-10.11-x86_64.egg/matplotlib/backends/backend_gtkagg.py", line 87, in _render_figure
    FigureCanvasAgg.draw(self)
  File "/Users/mcj/lib/python2.7/site-packages/matplotlib-2.0.0b1+1773.g3590ce2-py2.7-macosx-10.11-x86_64.egg/matplotlib/backends/backend_agg.py", line 464, in draw
    self.figure.draw(self.renderer)
  File "/Users/mcj/lib/python2.7/site-packages/matplotlib-2.0.0b1+1773.g3590ce2-py2.7-macosx-10.11-x86_64.egg/matplotlib/artist.py", line 68, in draw_wrapper
    return draw(artist, renderer, *args, **kwargs)
  File "/Users/mcj/lib/python2.7/site-packages/matplotlib-2.0.0b1+1773.g3590ce2-py2.7-macosx-10.11-x86_64.egg/matplotlib/figure.py", line 1262, in draw
    renderer, self, dsu, self.suppressComposite)
  File "/Users/mcj/lib/python2.7/site-packages/matplotlib-2.0.0b1+1773.g3590ce2-py2.7-macosx-10.11-x86_64.egg/matplotlib/image.py", line 139, in _draw_list_compositing_images
    a.draw(renderer)
  File "/Users/mcj/lib/python2.7/site-packages/matplotlib-2.0.0b1+1773.g3590ce2-py2.7-macosx-10.11-x86_64.egg/mpl_toolkits/mplot3d/axes3d.py", line 272, in draw
    for col in self.collections]
  File "/Users/mcj/lib/python2.7/site-packages/matplotlib-2.0.0b1+1773.g3590ce2-py2.7-macosx-10.11-x86_64.egg/mpl_toolkits/mplot3d/art3d.py", line 460, in do_3d_projection
    fcs = mcolors.to_rgba_array(fcs, self._alpha)
  File "/Users/mcj/lib/python2.7/site-packages/matplotlib-2.0.0b1+1773.g3590ce2-py2.7-macosx-10.11-x86_64.egg/matplotlib/colors.py", line 227, in to_rgba_array
    result[i] = to_rgba(cc, alpha)
  File "/Users/mcj/lib/python2.7/site-packages/matplotlib-2.0.0b1+1773.g3590ce2-py2.7-macosx-10.11-x86_64.egg/matplotlib/colors.py", line 134, in to_rgba
    rgba = _to_rgba_no_colorcycle(c, alpha)
  File "/Users/mcj/lib/python2.7/site-packages/matplotlib-2.0.0b1+1773.g3590ce2-py2.7-macosx-10.11-x86_64.egg/matplotlib/colors.py", line 192, in _to_rgba_no_colorcycle
    raise ValueError("RGBA values should be within 0-1 range")
ValueError: RGBA values should be within 0-1 range

Activity

  1. modified the milestones: , on Jul 6, 2016
  2. tacaswell commented on Jul 6, 2016

    Member

    I suspect someplace we have an alpha is None and the color conversion code expects an integer for alpha (and by suspect, I mean 'guess').

    We either clean up all the places we may have invalid alphas or make the color conversion code a bit more permissive.

    attn @anntzer

  3. anntzer commented on Jul 6, 2016

    Contributor

    Can't reproduce with python2.7, matplotlib 2.0b1 (built from source) and gtkagg backend.

  4. kaufman commented on Jul 6, 2016

    ContributorAuthor

    try with this data:
    asc = loadtxt('data.txt', dtype=np.float128)

    data.txt

  5. anntzer commented on Jul 6, 2016

    Contributor

    OK, got it. It's actually something completely different, and due to mishandling of float128s (that was probably exposed by the new color conversion machinery). A PR is on its way.

  6. modified the milestones: , on Jul 12, 2016
  7. tacaswell commented on Jul 12, 2016

    Member

    Closed by #6700

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL