I do not understand why my following code does not work:
#crit_theta.jl
using Plots
deg = 5
rad = deg/360 * 3.14159
a = 0.15
α = -0.9
f(x) = ((tand(x)-tand(deg))/a)^α
plt = plot(f,
5.1,
15,
title = "Bed height vs. critical angle",
xlabel = "Critical angle θ",
ylabel = "Dimensionless height h/d",
xlims = (4,15),
ylims = (0,25),
legend = false
)
savefig(plt,"height_v_theta.png")
~
When I run this, I get the following error:
ERROR: MethodError: objects of type Tuple{Plots.Plot{Plots.GRBackend}, String} are not callable
Stacktrace:
[1] top-level scope
@ REPL[29]:1
If I comment out the line for savefig, everything runs fine. Furthermore if I just type plt in the repl my plot displays perfectly. I am doubly confused because I thought savefig specifically took objects of type Tuple{Plots.Plot{Plots.GRBackend}, String}…am I missing something super obvious?