When I run the code cells to plot in Jupyter, all plots are displayed correctly in my .ipynb file. Then I got the following issues:
If I reopen the .ipynb file, all plots become texts, instead of a HTML or SVG block.
I have pushed the ipynb file into Github, and some plots can't be displayed.
For example, I wrote the following function (using a loop) to draw multiple plots:
# Iterate within different λ
function multiple_λ(λ_candidates)
for my_λ in λ_candidates
cost1, g1! = cost_and_gradient(zeros(28, 1), my_λ)
# Find the parameters
res = optimize(cost1, g1!, repeat([0.5], inner = size(feature, 2)))
mini_Θ = Optim.minimizer(res)
# Plot the decision boundaries
l2 = layer(z = (x1,x2) -> decision(x1, x2, mini_Θ),
x = linspace(-1.0, 1.5, 1000),
y = linspace(-1.0, 1.5, 1000),
Geom.contour(levels = [0.0]),
Theme(line_width = 1pt))
p5 = plot(l1, l2, coord,
Scale.color_discrete_manual(colorant"deep sky blue",
colorant"light pink"),
Guide.title("Regularization with λ = $(my_λ)"))
display(p5)
end
end
If I run multiple_λ([1, 1, 1, 10, 10]), there should be 5 plots and the first three are identical as the last two are identical. On Github, only two plots are displayed correctly.
When I run the code cells to plot in Jupyter, all plots are displayed correctly in my .ipynb file. Then I got the following issues:
I have pushed the ipynb file into Github, and some plots can't be displayed. For example, I wrote the following function (using a loop) to draw multiple plots:
If I run
multiple_λ([1, 1, 1, 10, 10])
, there should be 5 plots and the first three are identical as the last two are identical. On Github, only two plots are displayed correctly.The ipynb file can be visited here: https://github.com/xiaohk1997/test/blob/master/exercise2.ipynb
I have cross-posted this issue in Gadfly.jl. I am wondering how to fix it?
My Julia version is 0.5, and here is my
Pkg.status()