From d6cb5fcd5cbd1637a392b6184bf7fc8956b3a507 Mon Sep 17 00:00:00 2001 From: Takashi Imamichi <31178928+t-imamichi@users.noreply.github.com> Date: Wed, 20 Sep 2023 22:36:28 +0900 Subject: [PATCH] Fix a deprecation warning of matplotlib (#560) --- qiskit_optimization/applications/bin_packing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_optimization/applications/bin_packing.py b/qiskit_optimization/applications/bin_packing.py index 6f78d72aa..38b94803a 100755 --- a/qiskit_optimization/applications/bin_packing.py +++ b/qiskit_optimization/applications/bin_packing.py @@ -118,7 +118,7 @@ def get_figure(self, result: Union[OptimizationResult, np.ndarray]) -> Figure: """ import matplotlib.pyplot as plt - colors = plt.cm.get_cmap("jet", len(self._weights)) + colors = plt.colormaps["jet"].resampled(len(self._weights)) items_in_bins = self.interpret(result) num_bins = len(items_in_bins) fig, axes = plt.subplots()