Skip to content

Commit

Permalink
add plot3()
Browse files Browse the repository at this point in the history
  • Loading branch information
Uwe Fechner committed Mar 15, 2024
1 parent 04bc6e3 commit edec8a6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions test/plot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,26 @@ function plot2(X, Y1, Y2; labels=["", ""], fig="", title="")
xlabel("time [s]", fontsize=14)
xlim(0, X[end])
tight_layout()
end

function plot3(X, Y1, Y2, Y3; labels=["", "", ""], fig="", title="")
fig_ = PyPlot.figure(fig, figsize=(8, 6))
ax1 = PyPlot.subplot(311)
PyPlot.suptitle(title, fontsize=14) # Super title
PyPlot.plot(X, Y1, label=labels[1]);
ylabel(labels[1], fontsize=14);
PyPlot.grid(true)
setp(ax1.get_xticklabels(), visible=false)
ax2 = PyPlot.subplot(312, sharex = ax1)
PyPlot.plot(X, Y2, label=labels[2])
PyPlot.grid(true)
ylabel(labels[2], fontsize=14); grid(true)
setp(ax2.get_xticklabels(), visible=false)
ax3 = PyPlot.subplot(313, sharex = ax1)
PyPlot.plot(X, Y3, label=labels[3])
PyPlot.grid(true)
ylabel(labels[3], fontsize=14); grid(true)
xlabel("time [s]", fontsize=14)
xlim(0, X[end])
tight_layout()
end
4 changes: 2 additions & 2 deletions test/test_flightpathcontroller1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ end

include("plot.jl")

plot2(TIME, PSI, BETA; labels=["heading angle psi [°]","elevation β [°]"],
plot3(TIME, PSI, BETA, PSI_DOT;
labels=["heading angle psi [°]","elevation β [°]", "psi_dot [rad/s]"],
fig = "test_fpc1")
# p3 = plot1(TIME, PSI_DOT, label="psi_dot [rad/s]", fig = "psi_dot")

# return TIME, PSI, BETA, PHI, PSI_DOT

0 comments on commit edec8a6

Please sign in to comment.