Skip to content

Commit 1c79946

Browse files
authored
Merge pull request #60 from UoMResearchIT/16-pltshow-isnt-necessary-in-jupyter-notebooks
Add explanation for plt.show
2 parents d6519d9 + 50162af commit 1c79946

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

episodes/03-numpy_essential.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,18 @@ plt.show()
251251

252252
![](fig/gauss_curve_noisy.png){alt='Gaussian curve plot, with random noise added'}
253253

254+
::::::::::::::::::::::::::::::::::::::::: callout
255+
256+
## Matplotlib in Jupyter notebooks
257+
258+
By default, a Jupyter notebook evaluates and displays the final step in a cell. In the
259+
case of the 'matplotlib' library's `plot(...)` function, this means that it automatically
260+
displays a plot without requiring the `show()` function. However, since this function is
261+
required in other scenarios (e.g. a standalone python script), the course notes will include
262+
it each time it is required.
263+
264+
::::::::::::::::::::::::::::::::::::::::::::::::::
265+
254266
To identify any signal in the data we can use the standard deviation as an estimate of the noise around the mean value of the data.
255267

256268
```python

0 commit comments

Comments
 (0)