## Here is a block of julia code
# The two ## characters denote the start of the block
# If I type option-enter (on a mac) or alt-enter (Windows/Linux)
# then it will run the entire block
function squared(x)
return x*x
end
function add_values(x,y)
return x + y
end
add_values(squared(6), squared(6))
72
## Let's look at plotting quickly
using CairoMakie # what I use now...
##
using Plots # what I've used in the past...
x = range(1, step=10, length=100)
y = cumsum(rand(100))
plot(x,y) # this will plot the data
WARNING: both Plots and CairoMakie export "plot"; uses of it in module Main must be qualified
UndefVarError: `plot` not defined Stacktrace: [1] top-level scope @ In[3]:7
##
x = rand(10000)
y = randn(10000)
plot(
histogram(x, xlabel="Value", ylabel="Count", title="rand"),
histogram(y))
UndefVarError: `plot` not defined Stacktrace: [1] top-level scope @ In[4]:4