Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 683f3df

Browse filesBrowse files
committed
minor code cleanups
1 parent 7c9fd69 commit 683f3df
Copy full SHA for 683f3df

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed

‎examples/pylab_examples/image_masked.py

Copy file name to clipboardExpand all lines: examples/pylab_examples/image_masked.py
+5-5Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.