From 2ab28ff5ee8aa883eba54ccfc984b1cac4bc1aa6 Mon Sep 17 00:00:00 2001 From: Uwe Fechner Date: Sat, 23 Nov 2024 19:50:37 +0100 Subject: [PATCH] improve plots --- examples/calc_spectrum.jl | 10 ++-------- examples/plot_spectrum.jl | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/examples/calc_spectrum.jl b/examples/calc_spectrum.jl index cab5a3c0..b6ca08e3 100644 --- a/examples/calc_spectrum.jl +++ b/examples/calc_spectrum.jl @@ -156,7 +156,7 @@ function plot_spectrum(name) spectrum = jldopen("data/" * name * ".jld2") do file read(file, "spectrum") end - plt.figure("AOA amplitude vs f_ex") + plt.figure(name) plt.plot(spectrum.f_ex, todb.(spectrum.aoa_eff)) plt.xlabel("f_ex [Hz]") plt.ylabel("AOA amplitude [dB°]") @@ -164,11 +164,5 @@ function plot_spectrum(name) plt.grid(true) end -# plot(F_EX, todb.(AOA_EFF), xlabel="f_ex [Hz]", ylabel="AOA amplitude [dB°]", fig="AOA amplitude vs f_ex") -plt.figure("AOA amplitude vs f_ex") -plt.plot(F_EX, todb.(AOA_EFF)) -plt.xlabel("f_ex [Hz]") -plt.ylabel("AOA amplitude [dB°]") -plt.gca().set_xscale("log") -plt.grid(true) +plot_spectrum(spectrum.name) diff --git a/examples/plot_spectrum.jl b/examples/plot_spectrum.jl index 6397e755..7d329e3f 100644 --- a/examples/plot_spectrum.jl +++ b/examples/plot_spectrum.jl @@ -29,5 +29,5 @@ function plot_spectrum(name) plt.grid(true) end -plot_spectrum("spectrum_8.0_0.2") +plot_spectrum("spectrum_8.0_0.15") plot_spectrum("spectrum_8.0_0.0") \ No newline at end of file