Skip to content

Commit 7b0e9ea

Browse files
committed
Matplotlib-3.4.0 compatibility fix
1 parent 9b1aa47 commit 7b0e9ea

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

docs/Winpython_checker.ipynb

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"outputs": [],
1515
"source": [
1616
"import warnings\n",
17-
"warnings.filterwarnings(\"ignore\", category=DeprecationWarning)\n",
18-
"warnings.filterwarnings(\"ignore\", category=UserWarning)\n",
19-
"warnings.filterwarnings(\"ignore\", category=FutureWarning)\n",
17+
"#warnings.filterwarnings(\"ignore\", category=DeprecationWarning)\n",
18+
"#warnings.filterwarnings(\"ignore\", category=UserWarning)\n",
19+
"#warnings.filterwarnings(\"ignore\", category=FutureWarning)\n",
2020
"# warnings.filterwarnings(\"ignore\") # would silence all warnings"
2121
]
2222
},
@@ -192,27 +192,33 @@
192192
"metadata": {},
193193
"outputs": [],
194194
"source": [
195-
"# Matplotlib\n",
195+
"# Matplotlib 3.4.1\n",
196196
"# for more examples, see: http://matplotlib.org/gallery.html\n",
197197
"from mpl_toolkits.mplot3d import axes3d\n",
198198
"import matplotlib.pyplot as plt\n",
199199
"from matplotlib import cm\n",
200200
"\n",
201-
"fig = plt.figure()\n",
202-
"ax = fig.gca(projection='3d')\n",
201+
"ax = plt.figure().add_subplot(projection='3d')\n",
203202
"X, Y, Z = axes3d.get_test_data(0.05)\n",
203+
"\n",
204+
"# Plot the 3D surface\n",
204205
"ax.plot_surface(X, Y, Z, rstride=8, cstride=8, alpha=0.3)\n",
206+
"\n",
207+
"# Plot projections of the contours for each dimension. By choosing offsets\n",
208+
"# that match the appropriate axes limits, the projected contours will sit on\n",
209+
"# the 'walls' of the graph\n",
205210
"cset = ax.contourf(X, Y, Z, zdir='z', offset=-100, cmap=cm.coolwarm)\n",
206211
"cset = ax.contourf(X, Y, Z, zdir='x', offset=-40, cmap=cm.coolwarm)\n",
207212
"cset = ax.contourf(X, Y, Z, zdir='y', offset=40, cmap=cm.coolwarm)\n",
208213
"\n",
209-
"ax.set_xlabel('X')\n",
210214
"ax.set_xlim(-40, 40)\n",
211-
"ax.set_ylabel('Y')\n",
212215
"ax.set_ylim(-40, 40)\n",
213-
"ax.set_zlabel('Z')\n",
214216
"ax.set_zlim(-100, 100)\n",
215217
"\n",
218+
"ax.set_xlabel('X')\n",
219+
"ax.set_ylabel('Y')\n",
220+
"ax.set_zlabel('Z')\n",
221+
"\n",
216222
"plt.show()"
217223
]
218224
},
@@ -952,7 +958,7 @@
952958
"name": "python",
953959
"nbconvert_exporter": "python",
954960
"pygments_lexer": "ipython3",
955-
"version": "3.9.0rc1"
961+
"version": "3.9.2"
956962
},
957963
"widgets": {
958964
"state": {

0 commit comments

Comments
 (0)