Skip to content

Commit 4e6c6d8

Browse files
committed
Fixed issue by using PyPlot explicitly in an example
1 parent 95e525f commit 4e6c6d8

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

examples/collisions/Simulate_BouncingBall.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ function Base.getproperty(result::ModiaMath.ResultWithVariables, name::AbstractS
125125
return sig
126126
end
127127

128-
using PyPlot
129128
#=
129+
# The following commands can only be used if PyPlot is available
130+
using PyPlot
130131
using PyCall
131132
132133
fig, ax = PyPlot.subplots(figsize=(3,9))
@@ -140,8 +141,6 @@ pyplot_rc["grid.linewidth"] = 0.5
140141
pyplot_rc["axes.grid"] = true
141142
pyplot_rc["axes.titlesize"] = "medium"
142143
pyplot_rc["figure.titlesize"] = "medium"
143-
=#
144-
145144
146145
t1 = result1["time"]
147146
h1 = result1["h"]
@@ -154,22 +153,22 @@ v2 = result2."ball.v[3]"
154153
155154
figure(3)
156155
clf()
157-
158-
#=
159156
plot(t1,h1,"b", t2,h2,"r", t1,cor_res,"g")
160157
grid(true)
161158
xlabel("time [s]")
162159
ylabel("height [m]")
163160
legend(["impulsive response",
164161
"compliant response",
165162
"\$cor_{res}\$"])
166-
=#
163+
167164
plot(t1,h1,"b", t2,h2,"r")
168165
grid(true)
169166
xlabel("time [s]")
170167
ylabel("height [m]")
171168
legend(["impulsive response",
172169
"compliant response"])
170+
=#
171+
173172

174173
println("... success of examples/collisions/Simulate_BouncingBall.jl")
175174
end

0 commit comments

Comments
 (0)