Skip to content

Commit aeff5a2

Browse files
committed
more alt text
1 parent 9593ffc commit aeff5a2

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

content/05-scipy/scipy-basics-2.ipynb

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@
125125
"source": [
126126
"fig, ax = plt.subplots()\n",
127127
"ax.scatter(x,y)\n",
128-
"ax.errorbar(x, y, yerr=sigma, fmt=\"o\")"
128+
"ax.errorbar(x, y, yerr=sigma, fmt=\"o\")\n",
129+
"# alt-text: a plot showing data points with vertical error bars"
129130
]
130131
},
131132
{
@@ -214,7 +215,8 @@
214215
],
215216
"source": [
216217
"ax.plot(x, afit[0] + afit[1]*x + afit[2]*x*x )\n",
217-
"fig"
218+
"fig\n",
219+
"# alt-text: a plot showing data points with error bars and a quadratic fit to them"
218220
]
219221
},
220222
{
@@ -320,7 +322,8 @@
320322
"source": [
321323
"fig, ax = plt.subplots()\n",
322324
"ax.scatter(x,y)\n",
323-
"ax.errorbar(x, y, yerr=sigma, fmt=\"o\", label=\"_nolegend_\")"
325+
"ax.errorbar(x, y, yerr=sigma, fmt=\"o\", label=\"_nolegend_\")\n",
326+
"# alt-text: a plot showing a noisy exponential dataset with error bars"
324327
]
325328
},
326329
{
@@ -402,7 +405,8 @@
402405
" label=r\"$a_0 = $ %f; $a_1 = $ %f\" % (afit[0], afit[1]))\n",
403406
"ax.plot(x, a0_orig*np.exp(a1_orig*x), \":\", label=\"original function\")\n",
404407
"ax.legend(numpoints=1, frameon=False)\n",
405-
"fig"
408+
"fig\n",
409+
"# alt-text: a plot showing noisy exponential data points, a fit, and the original function"
406410
]
407411
},
408412
{
@@ -589,7 +593,8 @@
589593
"source": [
590594
"npts = 128\n",
591595
"xx, f = single_freq_sine(npts)\n",
592-
"plot_FFT(xx, f)"
596+
"plot_FFT(xx, f)\n",
597+
"# alt-text: a plot with 4 vertical panels showing (1) a sine (2) the Fourier transform of the sine (3) the power in Fourier space (4) the data transformed back to real space"
593598
]
594599
},
595600
{
@@ -645,7 +650,8 @@
645650
],
646651
"source": [
647652
"xx, f = single_freq_cosine(npts)\n",
648-
"plot_FFT(xx, f)"
653+
"plot_FFT(xx, f)\n",
654+
"# alt-text: a plot with 4 vertical panes showing a single-mode cosine transformed to Fourier space and back"
649655
]
650656
},
651657
{
@@ -701,7 +707,8 @@
701707
],
702708
"source": [
703709
"xx, f = single_freq_sine_plus_shift(npts)\n",
704-
"plot_FFT(xx, f)"
710+
"plot_FFT(xx, f)\n",
711+
"# alt-text: a plot with 4 vertical panes showing a single-mode sine with a phase shift transformed to Fourier space and back"
705712
]
706713
},
707714
{
@@ -782,7 +789,8 @@
782789
"xx, f = two_freq_sine(npts)\n",
783790
"\n",
784791
"fig, ax = plt.subplots()\n",
785-
"ax.plot(xx, f)"
792+
"ax.plot(xx, f)\n",
793+
"# alt-text: a plot showing a two-mode sine wave"
786794
]
787795
},
788796
{
@@ -847,7 +855,8 @@
847855
"fig, ax = plt.subplots()\n",
848856
"ax.plot(kfreq, fk.real, label=\"real\")\n",
849857
"ax.plot(kfreq, fk.imag, \":\", label=\"imaginary\")\n",
850-
"ax.legend(frameon=False)"
858+
"ax.legend(frameon=False)\n",
859+
"# alt-text: the FFT of our two-mode sine-wave showing two spikes"
851860
]
852861
},
853862
{
@@ -915,7 +924,8 @@
915924
],
916925
"source": [
917926
"fig, ax = plt.subplots()\n",
918-
"ax.plot(xx, fkinv.real)"
927+
"ax.plot(xx, fkinv.real)\n",
928+
"# alt-text: a plot of a single-mode sine wave"
919929
]
920930
},
921931
{
@@ -1278,7 +1288,8 @@
12781288
],
12791289
"source": [
12801290
"fig, ax = plt.subplots()\n",
1281-
"ax.plot(x[1:N-1], sol)"
1291+
"ax.plot(x[1:N-1], sol)\n",
1292+
"# alt-text: a plot showing a function that looks approximately like -sin(x)"
12821293
]
12831294
},
12841295
{
@@ -1305,7 +1316,7 @@
13051316
"name": "python",
13061317
"nbconvert_exporter": "python",
13071318
"pygments_lexer": "ipython3",
1308-
"version": "3.13.2"
1319+
"version": "3.14.2"
13091320
}
13101321
},
13111322
"nbformat": 4,

0 commit comments

Comments
 (0)