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

Skip to content

Commit 5970bde

Browse files
committed
Merge pull request matplotlib#921 from endolith/patch-6
Change colormaps for examples
2 parents 2b4ab26 + 8b80779 commit 5970bde

50 files changed

Lines changed: 101 additions & 81 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/mplot3d/contour3d_demo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
from mpl_toolkits.mplot3d import axes3d
22
import matplotlib.pyplot as plt
3+
from matplotlib import cm
34

45
fig = plt.figure()
56
ax = fig.add_subplot(111, projection='3d')
67
X, Y, Z = axes3d.get_test_data(0.05)
7-
cset = ax.contour(X, Y, Z)
8+
cset = ax.contour(X, Y, Z, cmap=cm.coolwarm)
89
ax.clabel(cset, fontsize=9, inline=1)
910

1011
plt.show()

examples/mplot3d/contour3d_demo2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
from mpl_toolkits.mplot3d import axes3d
22
import matplotlib.pyplot as plt
3+
from matplotlib import cm
34

45
fig = plt.figure()
56
ax = fig.gca(projection='3d')
67
X, Y, Z = axes3d.get_test_data(0.05)
7-
cset = ax.contour(X, Y, Z, extend3d=True)
8+
cset = ax.contour(X, Y, Z, extend3d=True, cmap=cm.coolwarm)
89
ax.clabel(cset, fontsize=9, inline=1)
910

1011
plt.show()

examples/mplot3d/contour3d_demo3.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
from mpl_toolkits.mplot3d import axes3d
22
import matplotlib.pyplot as plt
3+
from matplotlib import cm
34

45
fig = plt.figure()
56
ax = fig.gca(projection='3d')
67
X, Y, Z = axes3d.get_test_data(0.05)
78
ax.plot_surface(X, Y, Z, rstride=8, cstride=8, alpha=0.3)
8-
cset = ax.contour(X, Y, Z, zdir='z', offset=-100)
9-
cset = ax.contour(X, Y, Z, zdir='x', offset=-40)
10-
cset = ax.contour(X, Y, Z, zdir='y', offset=40)
9+
cset = ax.contour(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm)
10+
cset = ax.contour(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm)
11+
cset = ax.contour(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm)
1112

1213
ax.set_xlabel('X')
1314
ax.set_xlim(-40, 40)

examples/mplot3d/contourf3d_demo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
from mpl_toolkits.mplot3d import axes3d
22
import matplotlib.pyplot as plt
3+
from matplotlib import cm
34

45
fig = plt.figure()
56
ax = fig.gca(projection='3d')
67
X, Y, Z = axes3d.get_test_data(0.05)
7-
cset = ax.contourf(X, Y, Z)
8+
cset = ax.contourf(X, Y, Z, cmap=cm.coolwarm)
89
ax.clabel(cset, fontsize=9, inline=1)
910

1011
plt.show()

examples/mplot3d/contourf3d_demo2.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55

66
from mpl_toolkits.mplot3d import axes3d
77
import matplotlib.pyplot as plt
8+
from matplotlib import cm
89

910
fig = plt.figure()
1011
ax = fig.gca(projection='3d')
1112
X, Y, Z = axes3d.get_test_data(0.05)
1213
ax.plot_surface(X, Y, Z, rstride=8, cstride=8, alpha=0.3)
13-
cset = ax.contourf(X, Y, Z, zdir='z', offset=-100)
14-
cset = ax.contourf(X, Y, Z, zdir='x', offset=-40)
15-
cset = ax.contourf(X, Y, Z, zdir='y', offset=40)
14+
cset = ax.contourf(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm)
15+
cset = ax.contourf(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm)
16+
cset = ax.contourf(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm)
1617

1718
ax.set_xlabel('X')
1819
ax.set_xlim(-40, 40)

examples/mplot3d/subplot3d_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
X, Y = np.meshgrid(X, Y)
1818
R = np.sqrt(X**2 + Y**2)
1919
Z = np.sin(R)
20-
surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet,
20+
surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.coolwarm,
2121
linewidth=0, antialiased=False)
2222
ax.set_zlim3d(-1.01, 1.01)
2323

examples/mplot3d/surface3d_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
X, Y = np.meshgrid(X, Y)
1212
R = np.sqrt(X**2 + Y**2)
1313
Z = np.sin(R)
14-
surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet,
14+
surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.coolwarm,
1515
linewidth=0, antialiased=False)
1616
ax.set_zlim(-1.01, 1.01)
1717

examples/mplot3d/surface3d_radial_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
X,Y = R*np.cos(P),R*np.sin(P)
1919

2020
Z = ((R**2 - 1)**2)
21-
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet)
21+
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.YlGnBu_r)
2222
ax.set_zlim3d(0, 1)
2323
ax.set_xlabel(r'$\phi_\mathrm{real}$')
2424
ax.set_ylabel(r'$\phi_\mathrm{im}$')

examples/pylab_examples/agg_buffer_to_array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
ax.set_title('a simple figure')
1010
fig.canvas.draw()
1111

12-
# grab rhe pixel buffer and dumpy it into a numpy array
12+
# grab the pixel buffer and dump it into a numpy array
1313
buf = fig.canvas.buffer_rgba()
1414
l, b, w, h = fig.bbox.bounds
1515
X = np.frombuffer(buf, np.uint8)

examples/pylab_examples/anchored_artists.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(self, transform, size, label, loc,
2222
pad=0.1, borderpad=0.1, sep=2, prop=None, frameon=True):
2323
"""
2424
Draw a horizontal bar with the size in data coordinate of the give axes.
25-
A label will be drawn underneath (center-alinged).
25+
A label will be drawn underneath (center-aligned).
2626
2727
pad, borderpad in fraction of the legend font size (or prop)
2828
sep in points.

0 commit comments

Comments
 (0)