class_docstr: Silhouette Visualizer Tests
class_docstr_tok: ["Silhouette","Visualizer","Tests"]
docstr: Test no exceptions for modifying the colors in a silhouette visualizer
  by using a matplotlib colormap as colors
docstr_tok: ["Test","no","exceptions","for","modifying","the","colors","in","a","silhouette","visualizer","by","using","a","matplotlib","colormap","as","colors"]
code: def test_colormap_as_colors_silhouette(self):
      """
      Test no exceptions for modifying the colors in a silhouette visualizer
      by using a matplotlib colormap as colors
      """
      # Generate a blobs data set
      X, y = make_blobs(
          n_samples=1000,
          n_features=12,
          centers=8,
          shuffle=False,
          random_state=0,
      )
  
      fig = plt.figure()
      ax = fig.add_subplot()
  
      visualizer = SilhouetteVisualizer(
          MiniBatchKMeans(random_state=0), ax=ax, colors="cool"
      )
      visualizer.fit(X)
      visualizer.finalize()
  
      tol = (
          3.2 if sys.platform == "win32" else 0.01
      )  # Fails on AppVeyor with RMS 3.143
      self.assert_images_similar(
          visualizer, remove_legend=True, tol=tol
      )
  
imports: import sys
  import pytest
  import matplotlib.pyplot
  import numpy
  from sklearn.datasets import make_blobs
  from sklearn.cluster import KMeans, MiniBatchKMeans
  from sklearn.cluster import SpectralClustering, AgglomerativeClustering
  from unittest import mock
  from tests.base import VisualTestCase
  from yellowbrick.cluster.silhouette import SilhouetteVisualizer, silhouette_visualizer
label_desc: Use image node_id 6 for calling the TestSilhouetteVisualizer obj's underlying member method code with example usage: obj.test_colormap_as_colors_silhouette() without return types