Code
import plotly.express as px
import numpy as np
import plotly.io as pio
import plotly.graph_objects as go
import pandas as pd
= 'iframe' pio.renderers.default
As your project submissions will be in the form of a Jupyter notebook, it is important to fully utilize all available open-source python
libraries towards your project. Here, we briefly run through plotly
. As always, we begin with a few import statements; some of these are to ensure that the plots will generate correctly when we convert this notebook into an html file.
We begin with a very simple plot of \(y=sin\left(t \right)\) where \(t \in \left[0, 10 \right]\).
If we had multiple items that needed to be plotted, we would need to resort to a dataframe
.
Next, we will generate a contour plot! This requires us to define a grid along the horizontal and vertical axes, and a function that is defined at each grid point.