title: modifying colorbar in matplotlib and seaborn
body: <p>I'm trying to save an image I generated using seaborn. The image is 4x4 confusion matrix ('confmat' np.array). I learned that when I save the image in vector format, certain viewers have issues resulting in white lines on colorbar, quoting from matplotlib reference:</p>
  <blockquote>
  <p>It is known that some vector graphics viewer (svg and pdf) renders
  white gaps between segments of the colorbar. This is due to bugs in
  the viewers not matplotlib. As a workaround the colorbar can be
  rendered with overlapping segments:</p>
  <p>cbar = colorbar()</p>
  <p>cbar.solids.set_edgecolor(&quot;face&quot;)</p>
  <p>draw()</p>
  </blockquote>
  <p>However, I have trouble doing what is suggested.</p>
  <p>Here is what I did:</p>
  <pre><code>import seaborn as sns
  import matplotlib.pyplot as plt
  
  cmap=plt.cm.Blues
  
  fig, ax = plt.subplots()
      
  ax = sns.heatmap(confmat, annot=True, cmap=cmap)
  ax.set_title('title')
  ax.tick_params(
      axis='both',          # changes apply to the x-axis
      which='both',      # both major and minor ticks are affected
      bottom='off',      # ticks along the bottom edge are off
      top='off',         # ticks along the top edge are off
      labelbottom='off',  # labels along the bottom edge are off
      labelleft='off',
      right='off')
  
  fig.savefig('confusion_matrix.svg', format='svg')
  </code></pre>
  <p>I tried to get colorbar using</p>
  <pre><code>cbar = ax.colorbar()
  </code></pre>
  <p>But get an error AttributeError: 'AxesSubplot' object has no attribute 'colorbar'.</p>
  <p>I searched for solution and found a few questions here that suggest using plt.imshow() to get the colorbar object, but I'm completely confused about what I'm doing by now.
  Can someone suggest, and if possible, explain why, the solution for implementing what matplotlib documentation has offered for colorbar?</p>