GitLab system status is available here and here

Commit 1b12aea4 authored by Ethan Yeung's avatar Ethan Yeung
Browse files

session 8 prompt for coding journal 2

parent e67a85bf
%% Cell type:code id:a911dcf3 tags:
``` python
import matplotlib
import matplotlib.pyplot as plt
```
%% Cell type:code id:a70804ec tags:
``` python
import numpy as np
x = np.linspace(0, 1, 100)
```
%% Cell type:code id:142cf2e5 tags:
``` python
import math
def sine(x):
return math.sin(x)
def cosine(x):
return math.cos(x)
```
%% Cell type:code id:b98db233 tags:
``` python
s = []
for i in x:
s.append(sine(i))
c = []
for i in x:
c.append(cosine(i))
```
%% Cell type:code id:2247b94f tags:
``` python
fig, ax = plt.subplots(1, 2)
ax[0].plot(x, s)
ax[0].set_title("sin(x)")
ax[1].plot(x, c)
plt.savefig("cj2-8.pdf")
plt.show()
```
%% Output
%% Cell type:code id:7017d73a tags:
``` python
```
File added
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment