|
538 | 538 | "x_fine = np.linspace(0, 20, 10*N)\n", |
539 | 539 | "\n", |
540 | 540 | "ax.scatter(x, y)\n", |
541 | | - "ax.plot(x_fine, f_exact(x_fine), ls=\":\", label=\"original function\")" |
| 541 | + "ax.plot(x_fine, f_exact(x_fine), ls=\":\", label=\"original function\")\n", |
| 542 | + "# alt-text: a figure showing data points and an interpolant passing through them" |
542 | 543 | ] |
543 | 544 | }, |
544 | 545 | { |
|
578 | 579 | "ax.plot(x_fine, f_interp(x_fine), label=\"interpolant\")\n", |
579 | 580 | "\n", |
580 | 581 | "ax.legend(frameon=False, loc=\"best\")\n", |
581 | | - "fig" |
| 582 | + "fig\n", |
| 583 | + "# alt-text: a figure showing data points, an interpolant to them, and the original function we sampled" |
582 | 584 | ] |
583 | 585 | }, |
584 | 586 | { |
|
666 | 668 | "fig, ax = plt.subplots()\n", |
667 | 669 | "data = func(x, y)\n", |
668 | 670 | "im = ax.imshow(data.T, extent=(0, 1, 0, 1), origin=\"lower\")\n", |
669 | | - "fig.colorbar(im, ax=ax)" |
| 671 | + "fig.colorbar(im, ax=ax)\n", |
| 672 | + "# alt-text: a heat-map figure showing a function with small-amplitude ripples" |
670 | 673 | ] |
671 | 674 | }, |
672 | 675 | { |
|
714 | 717 | "source": [ |
715 | 718 | "fig, ax = plt.subplots()\n", |
716 | 719 | "im = ax.imshow(coarse.T, extent=(0, 1, 0, 1), origin=\"lower\")\n", |
717 | | - "fig.colorbar(im, ax=ax)" |
| 720 | + "fig.colorbar(im, ax=ax)\n", |
| 721 | + "# alt-text: a heat-map showing coarsened representation of our function" |
718 | 722 | ] |
719 | 723 | }, |
720 | 724 | { |
|
820 | 824 | "source": [ |
821 | 825 | "fig, ax = plt.subplots()\n", |
822 | 826 | "im = ax.imshow(new_data.T, extent=(0, 1, 0, 1), origin=\"lower\")\n", |
823 | | - "fig.colorbar(im, ax=ax)" |
| 827 | + "fig.colorbar(im, ax=ax)\n", |
| 828 | + "# alt-text: a heat-map showing the reconstructed function via interpolation" |
824 | 829 | ] |
825 | 830 | }, |
826 | 831 | { |
|
860 | 865 | "diff = new_data - data\n", |
861 | 866 | "fig, ax = plt.subplots()\n", |
862 | 867 | "im = ax.imshow(diff.T, origin=\"lower\", extent=(0, 1, 0, 1))\n", |
863 | | - "fig.colorbar(im, ax=ax)" |
| 868 | + "fig.colorbar(im, ax=ax)\n", |
| 869 | + "# alt-text: a heat-map showing the error in our interpolation. It is better than 10%" |
864 | 870 | ] |
865 | 871 | }, |
866 | 872 | { |
|
964 | 970 | "fig, ax = plt.subplots()\n", |
965 | 971 | "ax.plot(x, f(x))\n", |
966 | 972 | "ax.scatter(np.array([root]), np.array([f(root)]))\n", |
967 | | - "ax.grid()" |
| 973 | + "ax.grid()\n", |
| 974 | + "# alt-text: a plot of our function with the root represented as a point" |
968 | 975 | ] |
969 | 976 | }, |
970 | 977 | { |
|
1104 | 1111 | "fig = plt.figure()\n", |
1105 | 1112 | "ax = plt.axes(projection='3d')\n", |
1106 | 1113 | "ax.plot(X[0,:], X[1,:], X[2,:])\n", |
1107 | | - "fig.set_size_inches(8.0,6.0)" |
| 1114 | + "fig.set_size_inches(8.0,6.0)\n", |
| 1115 | + "# alt-text: a 3D line plot of the solution -- it is dominated by two lobe-like structures" |
1108 | 1116 | ] |
1109 | 1117 | }, |
1110 | 1118 | { |
|
1192 | 1200 | "\n", |
1193 | 1201 | "ax.plot(X[0,:], X[1,:], X[2,:])\n", |
1194 | 1202 | "\n", |
1195 | | - "ax.scatter(sol1.x[0], sol1.x[1], sol1.x[2], marker=\"x\", color=\"r\")\n", |
1196 | | - "ax.scatter(sol2.x[0], sol2.x[1], sol2.x[2], marker=\"x\", color=\"r\")\n", |
1197 | | - "ax.scatter(sol3.x[0], sol3.x[1], sol3.x[2], marker=\"x\", color=\"r\")\n", |
| 1203 | + "ax.scatter(sol1.x[0], sol1.x[1], sol1.x[2], marker=\"x\", color=\"C1\")\n", |
| 1204 | + "ax.scatter(sol2.x[0], sol2.x[1], sol2.x[2], marker=\"x\", color=\"C1\")\n", |
| 1205 | + "ax.scatter(sol3.x[0], sol3.x[1], sol3.x[2], marker=\"x\", color=\"C1\")\n", |
1198 | 1206 | "\n", |
1199 | 1207 | "ax.set_xlabel(\"x\")\n", |
1200 | 1208 | "ax.set_ylabel(\"y\")\n", |
1201 | | - "ax.set_zlabel(\"z\")" |
| 1209 | + "ax.set_zlabel(\"z\")\n", |
| 1210 | + "# alt-text: the 3D solution again represented as a line / trajectory, now with the stable-points marked" |
1202 | 1211 | ] |
1203 | 1212 | }, |
1204 | 1213 | { |
|
1342 | 1351 | "ax.loglog(ts, Ys[2,:], label=r\"$y_3$\")\n", |
1343 | 1352 | "\n", |
1344 | 1353 | "ax.legend(loc=\"best\", frameon=False)\n", |
1345 | | - "ax.set_xlabel(\"time\")" |
| 1354 | + "ax.set_xlabel(\"time\")\n", |
| 1355 | + "# alt-text: the time-evolution of the species on a log scale" |
1346 | 1356 | ] |
1347 | 1357 | }, |
1348 | 1358 | { |
|
1373 | 1383 | "name": "python", |
1374 | 1384 | "nbconvert_exporter": "python", |
1375 | 1385 | "pygments_lexer": "ipython3", |
1376 | | - "version": "3.13.3" |
| 1386 | + "version": "3.14.2" |
1377 | 1387 | } |
1378 | 1388 | }, |
1379 | 1389 | "nbformat": 4, |
|
0 commit comments