Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 683f3df

Browse files
committed
minor code cleanups
1 parent 7c9fd69 commit 683f3df

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

examples/pylab_examples/image_masked.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
get a filled contour effect.
66
"""
77
from copy import copy
8-
from numpy import ma
9-
import matplotlib.colors as colors
8+
9+
import numpy as np
1010
import matplotlib.pyplot as plt
11+
import matplotlib.colors as colors
1112
import matplotlib.mlab as mlab
12-
import numpy as np
1313

1414
# compute some interesting data
1515
x0, x1 = -5, 5
@@ -33,14 +33,14 @@
3333
# If you comment out all the palette.set* lines, you will see
3434
# all the defaults; under and over will be colored with the
3535
# first and last colors in the palette, respectively.
36-
Zm = ma.masked_where(Z > 1.2, Z)
36+
Zm = np.ma.masked_where(Z > 1.2, Z)
3737

3838
# By setting vmin and vmax in the norm, we establish the
3939
# range to which the regular palette color scale is applied.
4040
# Anything above that range is colored based on palette.set_over, etc.
4141

4242
# set up the axes
43-
fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(6, 5.4))
43+
fig, (ax1, ax2) = plt.subplots(nrows=2, figsize=(6, 5.4))
4444

4545
# plot using 'continuous' color map
4646
im = ax1.imshow(Zm, interpolation='bilinear',

0 commit comments

Comments
 (0)