8000 Changing the edge color and the line width in response to the comments · matplotlib/matplotlib@85e6634 · GitHub
[go: up one dir, main page]

Skip to content

Commit 85e6634

Browse files
committed
Changing the edge color and the line width in response to the comments
1 parent 5f67a3d commit 85e6634

File tree

2 files changed

+12
-< 10000 !-- -->10
lines changed

2 files changed

+12
-10
lines changed

examples/mplot3d/contour3d_3.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,21 @@
1111

1212
from mpl_toolkits.mplot3d import axes3d
1313
import matplotlib.pyplot as plt
14-
from matplotlib import cm
14+
from matplotlib.cm import coolwarm as cmap
1515

1616
ax = plt.figure().add_subplot(projection='3d')
1717
X, Y, Z = axes3d.get_test_data(0.05)
1818

1919
# Plot the 3D surface
20-
ax.plot_surface(X, Y, Z, edgecolor='black', rstride=8, cstride=8, alpha=0.3)
20+
ax.plot_surface(X, Y, Z, edgecolor=cmap(0), lw=0.5, rstride=8, cstride=8,
21+
alpha=0.3)
2122

2223
# Plot projections of the contours for each dimension. By choosing offsets
2324
# that match the appropriate axes limits, the projected contours will sit on
2425
# the 'walls' of the graph.
25-
ax.contour(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm)
26-
ax.contour(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm)
27-
ax.contour(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm)
26+
ax.contour(X, Y, Z, zdir='z', offset=-100, cmap=cmap)
27+
ax.contour(X, Y, Z, zdir='x', offset=-40, cmap=cmap)
28+
ax.contour(X, Y, Z, zdir='y', offset=40, cmap=cmap)
2829

2930
ax.set(xlim=(-40, 40), ylim=(-40, 40), zlim=(-100, 100),
3031
xlabel='X', ylabel='Y', zlabel='Z')

examples/mplot3d/contourf3d_2.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,21 @@
1111

1212
from mpl_toolkits.mplot3d import axes3d
1313
import matplotlib.pyplot as plt
14-
from matplotlib import cm
14+
from matplotlib.cm import coolwarm as cmap
1515

1616
ax = plt.figure().add_subplot(projection='3d')
1717
X, Y, Z = axes3d.get_test_data(0.05)
1818

1919
# Plot the 3D surface
20-
ax.plot_surface(X, Y, Z, edgecolor='black', rstride=8, cstride=8, alpha=0.3)
20+
ax.plot_surface(X, Y, Z, edgecolor=cmap(0), lw=0.5, rstride=8, cstride=8,
21+
alpha=0.3)
2122

2223
# Plot projections of the contours for each dimension. By choosing offsets
2324
# that match the appropriate axes limits, the projected contours will sit on
2425
# the 'walls' of the graph
25-
ax.contourf(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm)
26-
ax.contourf(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm)
27-
ax.contourf(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm)
26+
ax.contourf(X, Y, Z, zdir='z', offset=-100, cmap=cmap)
27+
ax.contourf(X, Y, Z, zdir='x', offset=-40, cmap=cmap)
28+
ax.contourf(X, Y, Z, zdir='y', offset=40, cmap=cmap)
2829

2930
ax.set(xlim=(-40, 40), ylim=(-40, 40), zlim=(-100, 100),
3031
xlabel='X', ylabel='Y', zlabel='Z')

0 commit comments

Comments
 (0)
0