Interactive Plotting with PowerShell and Polyglot Interactive Notebooks
PowerShell ScottPlot
Uses Polyglot Interactive Notebooks to demonstrate the capabilities of ScottPlot via PowerShell.
Repo: https://github.com/dfinke/PowerShellScottPlot
Check out the video
This walks through creating data visualizations with PowerShell and ScottPlot in the interactive notebook rendering visualizations inline.
ScottPlot
Is a free and open-source plotting library for .NET that makes it easy to interactively display large datasets.
How to run
- Follow these instructions to setup VS Code and the Polyglot Interactive Notebooks extension
- Clone the repo locally
git clone https://github.com/dfinke/PowerShellScottPlot.git
- Finally, open the
ScottPlot.ipynb
file in VS Code
Summary
There are two helper PowerShell scripts.
- ScottPlotHelper.ps1
- Loads the
ScottPlot.dll
andpsgraphNB.ps1
- Has the
Show-ScottPlotInNotebook
functionShow-ScottPlotInNotebook $plt "$pwd\test.png"
- Takes a ScottPlot plot, and name of the image file to generate
- Generates the image file
- Calls the
Show-ImageInNotebook
function frompsgraphNB.ps1
- Then removes the image file
- Loads the
- PSGraphNB.ps1
- Has the
Show-ImageInNotebook
functionShow-ImageInNotebook "$pwd\test.png"
- Takes the name of the image file to display
- Displays the image in the output cell of the notebook
- Has the
What’s in the notebook
A simple way to share Polyglot Notebooks
Check out the rendered notebook and charts here in nbviewer.