Skip to content

Commit

Permalink
Merge pull request #388 from JuliaReach/schillic/savefig
Browse files Browse the repository at this point in the history
Fix commented `savefig` command in models
  • Loading branch information
schillic authored Apr 11, 2024
2 parents fc8f6cc + 1e9774b commit c74aaa9
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion models/ACC/ACC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ end;
# Plot the results:

fig = plot_helper(sol_relu, sim_relu)
## Plots.savefig(fig, "ACC-ReLU.png") # command to save the plot to a file
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## savefig(fig, "ACC-ReLU.png") # command to save the plot to a file

#-

Expand Down
2 changes: 1 addition & 1 deletion models/Airplane/Airplane.jl
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ else
xlims!(-0.55, 0.55)
ylims!(-1.05, 1.05)
end
## Plots.savefig(fig, "Airplane.png") # command to save the plot to a file
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## savefig(fig, "Airplane.png") # command to save the plot to a file

end #jl
nothing #jl
2 changes: 1 addition & 1 deletion models/AttitudeControl/AttitudeControl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ end;
vars = (1, 2)
fig = plot_helper(vars)
plot!(fig; xlab="ω₁", ylab="ω₂")
## Plots.savefig(fig, "AttitudeControl.png") # command to save the plot to a file
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## savefig(fig, "AttitudeControl.png") # command to save the plot to a file

end #jl
nothing #jl
Expand Down
2 changes: 1 addition & 1 deletion models/InvertedPendulum/InvertedPendulum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ end;
# Plot the results:

fig = plot_helper()
## Plots.savefig(fig, "InvertedPendulum.png") # command to save the plot to a file
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## savefig(fig, "InvertedPendulum.png") # command to save the plot to a file

end #jl
nothing #jl
8 changes: 4 additions & 4 deletions models/InvertedTwoLinkPendulum/InvertedTwoLinkPendulum.jl
Original file line number Diff line number Diff line change
Expand Up @@ -263,18 +263,18 @@ end;
vars=(3, 4)
fig = plot_helper(vars, sol_lr, sim_lr, prob_lr, spec_lr)
plot!(fig; xlab="θ₁'", ylab="θ₂'")
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## Command to save the plot to a file:
## savefig(fig, "InvertedTwoLinkPendulum-less-robust.png")
## Plots.savefig(fig, "InvertedTwoLinkPendulum-less-robust.png")
fig = DisplayAs.Text(DisplayAs.PNG(fig))

#-

vars=(3, 4)
fig = plot_helper(vars, sol_mr, sim_mr, prob_mr, spec_mr)
plot!(fig; xlab="θ₁'", ylab="θ₂'")
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## Command to save the plot to a file:
## savefig(fig, "InvertedTwoLinkPendulum-more-robust.png")
## Plots.savefig(fig, "InvertedTwoLinkPendulum-more-robust.png")
fig = DisplayAs.Text(DisplayAs.PNG(fig))

end #jl
nothing #jl
2 changes: 1 addition & 1 deletion models/Quadrotor/Quadrotor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ end;
vars = (0, 3)
fig = plot_helper(vars)
plot!(fig; xlab="t", ylab="x₃")
## Plots.savefig(fig, "Quadrotor.png") # command to save the plot to a file
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## savefig(fig, "Quadrotor.png") # command to save the plot to a file

end #jl
nothing #jl
Expand Down
4 changes: 2 additions & 2 deletions models/SpacecraftDocking/SpacecraftDocking.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,16 @@ end;
vars = (1, 2)
fig = plot_helper(vars)
plot!(fig; xlab="x", ylab="y")
## Plots.savefig(fig, "SpacecraftDocking-x-y.png") # command to save the plot to a file
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## savefig(fig, "SpacecraftDocking-x-y.png") # command to save the plot to a file

#-

vars = (3, 4)
fig = plot_helper(vars)
plot!(fig; xlab="x'", ylab="y'")
## Plots.savefig(fig, "SpacecraftDocking-x'-y'.png") # command to save the plot to a file
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## savefig(fig, "SpacecraftDocking-x'-y'.png") # command to save the plot to a file

end #jl
nothing #jl
Expand Down
8 changes: 4 additions & 4 deletions models/TORA/TORA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,16 @@ end;
vars = (1, 2)
fig = plot_helper1(vars)
plot!(fig; xlab="x₁", ylab="x₂")
## Plots.savefig(fig, "TORA-ReLU-x1-x2.png") # command to save the plot to a file
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## savefig(fig, "TORA-ReLU-x1-x2.png") # command to save the plot to a file

#-

vars = (3, 4)
fig = plot_helper1(vars)
plot!(fig; xlab="x₃", ylab="x₄")
## Plots.savefig(fig, "TORA-ReLU-x3-x4.png") # command to save the plot to a file
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## savefig(fig, "TORA-ReLU-x3-x4.png") # command to save the plot to a file

#-

Expand All @@ -305,8 +305,8 @@ lens!(fig, [-0.785, -0.735], [-0.47, -0.41]; inset=(1, bbox(0.2, 0.4, 0.2, 0.2))
lc=:black, xticks=[-0.77, -0.75], yticks=[-0.45, -0.43], subplot=3)
lens!(fig, [0.0, 0.25], [-0.85, -0.7]; inset=(1, bbox(0.6, 0.4, 0.2, 0.2)),
lc=:black, xticks=[0, 0.2], yticks=[-0.8, -0.7], subplot=3)
## Plots.savefig(fig, "TORA-ReLUtanh.png") # command to save the plot to a file
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## savefig(fig, "TORA-ReLUtanh.png") # command to save the plot to a file

#-

Expand All @@ -315,8 +315,8 @@ lens!(fig, [-0.785, -0.735], [-0.47, -0.41]; inset=(1, bbox(0.2, 0.4, 0.2, 0.2))
lc=:black, xticks=[-0.77, -0.75], yticks=[-0.45, -0.43], subplot=3)
lens!(fig, [0.09, 0.22], [-0.9, -0.8]; inset=(1, bbox(0.6, 0.4, 0.2, 0.2)),
lc=:black, xticks=[0.1, 0.2], yticks=[-0.9, -0.8], subplot=3)
## Plots.savefig(fig, "TORA-sigmoid.png") # command to save the plot to a file
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## savefig(fig, "TORA-sigmoid.png") # command to save the plot to a file

end #jl
nothing #jl
Expand Down
4 changes: 2 additions & 2 deletions models/Unicycle/Unicycle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ lens!(fig, [9.49, 9.56], [-4.51, -4.44]; inset=(1, bbox(0.65, 0.05, 0.25, 0.25))
lc=:black, xticks=[9.5, 9.55], yticks=[-4.5, -4.45], subplot=2)
lens!(fig, [0.3, 0.7], [-0.25, 0.25]; inset=(1, bbox(0.1, 0.3, 0.25, 0.25)),
lc=:black, xticks=[0.4, 0.6], yticks=[-0.2, 0.2], subplot=3)
## Plots.savefig(fig, "Unicycle-x1-x2.png") # command to save the plot to a file
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## savefig(fig, "Unicycle-x1-x2.png") # command to save the plot to a file

#-

Expand All @@ -192,8 +192,8 @@ lens!(fig, [2.09, 2.12], [1.495, 1.515]; inset=(1, bbox(0.72, 0.54, 0.25, 0.25))
lc=:black, xticks=[2.1, 2.11], yticks=[1.5, 1.51], subplot=2)
lens!(fig, [-0.1, 0.03], [-0.4, -0.15]; inset=(1, bbox(0.1, 0.1, 0.25, 0.25)),
lc=:black, xticks=[-0.08, 0], yticks=[-0.3, -0.2], subplot=3)
## Plots.savefig(fig, "Unicycle-x3-x4.png") # command to save the plot to a file
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## savefig(fig, "Unicycle-x3-x4.png") # command to save the plot to a file

end #jl
nothing #jl
Expand Down
4 changes: 2 additions & 2 deletions models/VerticalCAS/VerticalCAS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ fig = plot_helper()
for o in sol_random
plot!(fig, o; alpha=1, markershape=:none)
end
## Plots.savefig("VerticalCAS-rand.png") # command to save the plot to a file
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## savefig("VerticalCAS-rand.png") # command to save the plot to a file

#-

Expand All @@ -400,8 +400,8 @@ for (i, c) in [(1, :brown), (2, :green), (3, :orange), (4, :cyan)]
lab = ""
end
end
## Plots.savefig("VerticalCAS-sets.png") # command to save the plot to a file
fig = DisplayAs.Text(DisplayAs.PNG(fig))
## savefig("VerticalCAS-sets.png") # command to save the plot to a file

end #jl
nothing #jl
Expand Down

0 comments on commit c74aaa9

Please sign in to comment.