Repository: scikit-image/scikit-image

Issue:
issue building gallery examples on Travis
## Description
In recent PRs, I have experience a lot of Travis failures unrelated to the PR.  These occur during building the gallery examples and seem to be related to a problem with the 2D RGB array used in the `plot_matches` utility:
https://github.com/scikit-image/scikit-image/blob/e55b2742307b577d7f86c75c52701332226ee4af/skimage/feature/util.py#L116-L123

I did not see this failure on my local machine with Matplotlib 2.0.0, but it does occur after upgrading to 2.0.1.  Will look into whether just using a 1D array fixes the problem.


The traceback from travis occurs for multiple examples using this utility such as `plot_orb.py` and `plot_brief.py`.  One traceback:

```
/home/travis/build/scikit-image/scikit-image/doc/examples/features_detection/plot_orb.py failed to execute correctly:Traceback (most recent call last):

  File "/home/travis/venv/lib/python3.4/site-packages/matplotlib/colors.py", line 141, in to_rgba

    rgba = _colors_full_map.cache[c, alpha]

TypeError: unhashable type: 'numpy.ndarray'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/home/travis/build/scikit-image/scikit-image/doc/source/../ext/sphinx_gallery/gen_rst.py", line 486, in execute_code_block

    block_vars['fig_count'], gallery_conf)

  File "/home/travis/build/scikit-image/scikit-image/doc/source/../ext/sphinx_gallery/gen_rst.py", line 266, in save_figures

    fig.savefig(current_fig, **kwargs)

  File "/home/travis/venv/lib/python3.4/site-packages/matplotlib/figure.py", line 1573, in savefig

    self.canvas.print_figure(*args, **kwargs)

  File "/home/travis/venv/lib/python3.4/site-packages/matplotlib/backend_bases.py", line 2252, in print_figure

    **kwargs)

  File "/home/travis/venv/lib/python3.4/site-packages/matplotlib/backends/backend_agg.py", line 545, in print_png

    FigureCanvasAgg.draw(self)

  File "/home/travis/venv/lib/python3.4/site-packages/matplotlib/backends/backend_agg.py", line 464, in draw

    self.figure.draw(self.renderer)

  File "/home/travis/venv/lib/python3.4/site-packages/matplotlib/artist.py", line 63, in draw_wrapper

    draw(artist, renderer, *args, **kwargs)

  File "/home/travis/venv/lib/python3.4/site-packages/matplotlib/figure.py", line 1144, in draw

    renderer, self, dsu, self.suppressComposite)

  File "/home/travis/venv/lib/python3.4/site-packages/matplotlib/image.py", line 139, in _draw_list_compositing_images

    a.draw(renderer)

  File "/home/travis/venv/lib/python3.4/site-packages/matplotlib/artist.py", line 63, in draw_wrapper

    draw(artist, renderer, *args, **kwargs)

  File "/home/travis/venv/lib/python3.4/site-packages/matplotlib/axes/_base.py", line 2426, in draw

    mimage._draw_list_compositing_images(renderer, self, dsu)

  File "/home/travis/venv/lib/python3.4/site-packages/matplotlib/image.py", line 139, in _draw_list_compositing_images

    a.draw(renderer)

  File "/home/travis/venv/lib/python3.4/site-packages/matplotlib/artist.py", line 63, in draw_wrapper

    draw(artist, renderer, *args, **kwargs)

  File "/home/travis/venv/lib/python3.4/site-packages/matplotlib/lines.py", line 803, in draw

    ln_color_rgba = self._get_rgba_ln_color()

  File "/home/travis/venv/lib/python3.4/site-packages/matplotlib/lines.py", line 1344, in _get_rgba_ln_color

    return mcolors.to_rgba(self._color, self._alpha)

  File "/home/travis/venv/lib/python3.4/site-packages/matplotlib/colors.py", line 143, in to_rgba

    rgba = _to_rgba_no_colorcycle(c, alpha)

  File "/home/travis/venv/lib/python3.4/site-packages/matplotlib/colors.py", line 194, in _to_rgba_no_colorcycle

    raise ValueError("Invalid RGBA argument: {!r}".format(orig_c))

ValueError: Invalid RGBA argument: array([[ 0.92178129],

       [ 0.26695828],

       [ 0.37959337]])
```

Full logs from one of the PRs where this occurred are here:
https://travis-ci.org/scikit-image/scikit-image/builds/228992100?utm_source=github_status&utm_medium=notification




Discussion:

Resolving patch:
diff --git a/skimage/feature/util.py b/skimage/feature/util.py
--- a/skimage/feature/util.py
+++ b/skimage/feature/util.py
@@ -114,7 +114,7 @@ def plot_matches(ax, image1, image2, keypoints1, keypoints2, matches,
         idx2 = matches[i, 1]
 
         if matches_color is None:
-            color = np.random.rand(3, 1)
+            color = np.random.rand(3)
         else:
             color = matches_color
 


Test patch: