|
21 | 21 |
|
22 | 22 | # Plot projections of the contours for each dimension. By choosing offsets |
23 | 23 | # that match the appropriate axes limits, the projected contours will sit on |
24 | | -# the 'walls' of the graph |
25 | | -cset = ax.contour(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm) |
26 | | -cset = ax.contour(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm) |
27 | | -cset = ax.contour(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm) |
28 | | - |
29 | | -ax.set_xlim(-40, 40) |
30 | | -ax.set_ylim(-40, 40) |
31 | | -ax.set_zlim(-100, 100) |
32 | | - |
33 | | -ax.set_xlabel('X') |
34 | | -ax.set_ylabel('Y') |
35 | | -ax.set_zlabel('Z') |
| 24 | +# 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) |
| 28 | + |
| 29 | +ax.set(xlim=(-40, 40), ylim=(-40, 40), zlim=(-100, 100), |
| 30 | + xlabel='X', ylabel='Y', zlabel='Z') |
36 | 31 |
|
37 | 32 | plt.show() |
0 commit comments