Skip to content

Commit 3d98242

Browse files
committed
doc: better syntax for plot! in manual
1 parent 3c74484 commit 3d98242

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/src/manual/linmpc.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ Lastly, we plot the closed-loop test with the `Plots` package:
140140
using Plots
141141
function plot_data(t_data, u_data, y_data, ry_data)
142142
p1 = plot(t_data, y_data[1,:], label="meas."); ylabel!("level")
143-
plot!(t_data, ry_data[1,:], label="setpoint", linestyle=:dash, linetype=:steppost)
144-
plot!(t_data, fill(45,size(t_data)), label="min", linestyle=:dot, linewidth=1.5)
143+
plot!(p1, t_data, ry_data[1,:], label="setpoint", linestyle=:dash, linetype=:steppost)
144+
plot!(p1, t_data, fill(45,size(t_data)), label="min", linestyle=:dot, linewidth=1.5)
145145
p2 = plot(t_data, y_data[2,:], label="meas.", legend=:topleft); ylabel!("temp.")
146-
plot!(t_data, ry_data[2,:],label="setpoint", linestyle=:dash, linetype=:steppost)
146+
plot!(p2, t_data, ry_data[2,:],label="setpoint", linestyle=:dash, linetype=:steppost)
147147
p3 = plot(t_data,u_data[1,:],label="cold", linetype=:steppost); ylabel!("flow rate")
148-
plot!(t_data,u_data[2,:],label="hot", linetype=:steppost); xlabel!("time (s)")
148+
plot!(p3, t_data,u_data[2,:],label="hot", linetype=:steppost); xlabel!("time (s)")
149149
return plot(p1, p2, p3, layout=(3,1))
150150
end
151151
plot_data(t_data, u_data, y_data, ry_data)

0 commit comments

Comments
 (0)