Skip to content

Commit 7890760

Browse files
committed
feat(07b_VSCode.md): add things to try if plots aren't showing up while debugging
1 parent 9dbb8c3 commit 7890760

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

notebooks/part0_python_intro/07b_VSCode.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ The Run and Debug view on the left (available via the Activity Bar) shows the cu
115115
### Plotting
116116
During a debug session, as long as matplotlib has been imported, one can make plots via the Debug Console or by putting plotting code in the script.
117117
118+
**If the plot isn't showing up**
119+
* Try making the plot by starting with `fig, ax = plt.subplots()` syntax (instead of `plt.plot()`)
120+
* Then in the debug console enter `fig.show()` or `plt.draw()`
121+
* Alternativey, try `plt.pause(1)`
122+
* On Windows, look in the task bar for a matplotlib icon <img src="https://upload.wikimedia.org/wikipedia/commons/8/84/Matplotlib_icon.svg" alt="drawing" width="40"/> (or press Alt + Tab to show the open windows)
123+
118124
### Automatic docstring generation
119125
Right click at the beginning of the first line *below* the ``def`` statement for any of the functions and choose ``Generate docstring``. The autoDocstring extension should make a new template for a docstring that includes all of the parameters listed in the function signature.
120126

0 commit comments

Comments
 (0)