plots
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# %% imports
|
# %% imports
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from matplotlib import pyplot as plt
|
from matplotlib import pyplot as plt
|
||||||
|
from matplotlib.ticker import EngFormatter
|
||||||
|
|
||||||
from charon_vna.util import db20, net2s, s2net
|
from charon_vna.util import db20, net2s, s2net
|
||||||
from charon_vna.vna import Charon
|
from charon_vna.vna import Charon
|
||||||
@@ -46,8 +47,13 @@ for m in s.m.data:
|
|||||||
plt.plot(s2.frequency, db20(s2.sel(m=m, n=n)), label="$S_{" + str(m) + str(n) + "}$ (calibrated)")
|
plt.plot(s2.frequency, db20(s2.sel(m=m, n=n)), label="$S_{" + str(m) + str(n) + "}$ (calibrated)")
|
||||||
plt.grid(True)
|
plt.grid(True)
|
||||||
plt.legend()
|
plt.legend()
|
||||||
|
plt.xlabel("Frequency [Hz]")
|
||||||
plt.ylabel("Magnitude [dB]")
|
plt.ylabel("Magnitude [dB]")
|
||||||
# plt.ylim(-30, 5)
|
# plt.ylim(-30, 5)
|
||||||
|
plt.ylim(-25, 5)
|
||||||
|
plt.xlim(s.frequency[0], s.frequency[-1])
|
||||||
|
plt.gca().xaxis.set_major_formatter(EngFormatter())
|
||||||
|
plt.tight_layout()
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
for m in s.m.data:
|
for m in s.m.data:
|
||||||
@@ -66,6 +72,10 @@ for m in s.m.data:
|
|||||||
plt.grid(True)
|
plt.grid(True)
|
||||||
plt.legend()
|
plt.legend()
|
||||||
plt.ylabel("Phase [deg]")
|
plt.ylabel("Phase [deg]")
|
||||||
|
plt.xlabel("Frequency [Hz]")
|
||||||
|
plt.xlim(s.frequency[0], s.frequency[-1])
|
||||||
|
plt.gca().xaxis.set_major_formatter(EngFormatter())
|
||||||
|
plt.tight_layout()
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
|
Reference in New Issue
Block a user