### 4.1 - Packages

# Q1
#=
using Pkg
Pkg.add("Primes")
=#
# Alternatively, use the package manager in the REPL

# Q2
using Primes
#primes_lst = primes(1000000) # This takes a while.


### 4.2 - Plots

using Plots
#=
# Define data
globaltemperatures = [14.4, 14.5, 14.8, 15.2, 15.5, 15.8];
numpirates = [45000, 20000, 15000, 5000, 400, 17];

# Activate a plotting backend
gr()

# Plot data
p = plot(numpirates, globaltemperatures, label="line", size = (1200, 800));

scatter!(p, numpirates, globaltemperatures, label="points") ;
=#


# Q1

gr()

x = -10:0.2:10;
y = x.^2;

p = plot(x,y, legend = false);
scatter!(p, x, y)


# Q2

p1 = plot(x, x);
p2 = plot(x, x.^2);
p3 = plot(x, x.^3);
p4 = plot(x, x.^4);
plot(p1, p2, p3, p4, layout = (4, 1), legend = false)