Skip to content

Commit

Permalink
Fix matplotlib deprecation warning (#6072)
Browse files Browse the repository at this point in the history
* Fix matplotlib deprecation warning

* Fix for better deprecation
  • Loading branch information
dstrain115 committed Apr 21, 2023
1 parent 66ae2bc commit 03405d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cirq-core/cirq/vis/heatmap_test.py
Expand Up @@ -97,7 +97,7 @@ def test_cell_colors(ax, colormap_name):
)
_, mesh = random_heatmap.plot(ax)

colormap = mpl.cm.get_cmap(colormap_name)
colormap = mpl.colormaps[colormap_name]
for path, facecolor in zip(mesh.get_paths(), mesh.get_facecolors()):
vertices = path.vertices[0:4]
row = int(round(np.mean([v[1] for v in vertices])))
Expand Down Expand Up @@ -218,7 +218,7 @@ def __format__(self, format_string):

_, mesh = random_heatmap.plot(ax)

colormap = mpl.cm.get_cmap(colormap_name)
colormap = mpl.colormaps[colormap_name]
for path, facecolor in zip(mesh.get_paths(), mesh.get_facecolors()):
vertices = path.vertices[0:4]
row = int(round(np.mean([v[1] for v in vertices])))
Expand Down

0 comments on commit 03405d1

Please sign in to comment.