diff --git a/lib/matplotlib/backends/backend_agg.py b/lib/matplotlib/backends/backend_agg.py index c4d93d9a9a89..fd262c2bb710 100644 --- a/lib/matplotlib/backends/backend_agg.py +++ b/lib/matplotlib/backends/backend_agg.py @@ -356,7 +356,7 @@ def post_processing(image, dpi): self._update_methods() if w > 0 and h > 0: - img = np.fromstring(buffer, np.uint8) + img = np.frombuffer(buffer, np.uint8) img, ox, oy = post_processing(img.reshape((h, w, 4)) / 255., self.dpi) gc = self.new_gc() diff --git a/lib/matplotlib/dates.py b/lib/matplotlib/dates.py index a229e09f5e63..41f78ca98abb 100644 --- a/lib/matplotlib/dates.py +++ b/lib/matplotlib/dates.py @@ -1348,10 +1348,9 @@ def get_locator(self, dmin, dmax): else: locator = MicrosecondLocator(interval, tz=self.tz) if dmin.year > 20 and interval < 1000: - _log.warn('Plotting microsecond time intervals is not' - ' well supported. Please see the' - ' MicrosecondLocator documentation' - ' for details.') + _log.warning('Plotting microsecond time intervals is not well ' + 'supported. Please see the MicrosecondLocator ' + 'documentation for details.') locator.set_axis(self.axis) diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index b9f5d5ae4930..1641bac9cc0e 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -1460,9 +1460,9 @@ def pil_to_array(pilImage): # return MxN luminance array of uint16 raw = pilImage.tobytes('raw', pilImage.mode) if pilImage.mode.endswith('B'): - x = np.fromstring(raw, '>u2') + x = np.frombuffer(raw, '>u2') else: - x = np.fromstring(raw, '