Skip to content

Commit

Permalink
use_line_collection no longer needed in newer matplotlib
Browse files Browse the repository at this point in the history
  • Loading branch information
craig-warren committed Jan 30, 2024
1 parent 2f856d7 commit 4d5afa8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion toolboxes/Plotting/plot_Ascan.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def mpl_plot(filename, outputs=Rx.defaultoutputs, fft=False, save=False):

# Plot frequency spectra
markerline, stemlines, baseline = ax2.stem(
freqs[pltrange], power[pltrange], "-.", use_line_collection=True
freqs[pltrange], power[pltrange], "-."
)
plt.setp(baseline, "linewidth", 0)
plt.setp(stemlines, "color", "r")
Expand Down
24 changes: 12 additions & 12 deletions toolboxes/Plotting/plot_antenna_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def mpl_plot(

# Plot frequency spectra of incident voltage
ax = plt.subplot(gs1[0, 1])
markerline, stemlines, baseline = ax.stem(freqs[pltrange], Vincp[pltrange], "-.", use_line_collection=True)
markerline, stemlines, baseline = ax.stem(freqs[pltrange], Vincp[pltrange], "-.")
plt.setp(baseline, "linewidth", 0)
plt.setp(stemlines, "color", "r")
plt.setp(markerline, "markerfacecolor", "r", "markeredgecolor", "r")
Expand All @@ -270,7 +270,7 @@ def mpl_plot(

# Plot frequency spectra of incident current
ax = plt.subplot(gs1[1, 1])
markerline, stemlines, baseline = ax.stem(freqs[pltrange], Iincp[pltrange], "-.", use_line_collection=True)
markerline, stemlines, baseline = ax.stem(freqs[pltrange], Iincp[pltrange], "-.")
plt.setp(baseline, "linewidth", 0)
plt.setp(stemlines, "color", "b")
plt.setp(markerline, "markerfacecolor", "b", "markeredgecolor", "b")
Expand All @@ -291,7 +291,7 @@ def mpl_plot(

# Plot frequency spectra of total voltage
ax = plt.subplot(gs1[2, 1])
markerline, stemlines, baseline = ax.stem(freqs[pltrange], Vtotalp[pltrange], "-.", use_line_collection=True)
markerline, stemlines, baseline = ax.stem(freqs[pltrange], Vtotalp[pltrange], "-.")
plt.setp(baseline, "linewidth", 0)
plt.setp(stemlines, "color", "r")
plt.setp(markerline, "markerfacecolor", "r", "markeredgecolor", "r")
Expand All @@ -312,7 +312,7 @@ def mpl_plot(

# Plot frequency spectra of total current
ax = plt.subplot(gs1[3, 1])
markerline, stemlines, baseline = ax.stem(freqs[pltrange], Itotalp[pltrange], "-.", use_line_collection=True)
markerline, stemlines, baseline = ax.stem(freqs[pltrange], Itotalp[pltrange], "-.")
plt.setp(baseline, "linewidth", 0)
plt.setp(stemlines, "color", "b")
plt.setp(markerline, "markerfacecolor", "b", "markeredgecolor", "b")
Expand All @@ -334,7 +334,7 @@ def mpl_plot(
# Plot frequency spectra of reflected voltage
# ax = plt.subplot(gs1[4, 1])
# markerline, stemlines, baseline = ax.stem(freqs[pltrange], Vrefp[pltrange],
# '-.', use_line_collection=True)
# '-.')
# plt.setp(baseline, 'linewidth', 0)
# plt.setp(stemlines, 'color', 'r')
# plt.setp(markerline, 'markerfacecolor', 'r', 'markeredgecolor', 'r')
Expand All @@ -356,7 +356,7 @@ def mpl_plot(
# Plot frequency spectra of reflected current
# ax = plt.subplot(gs1[5, 1])
# markerline, stemlines, baseline = ax.stem(freqs[pltrange], Irefp[pltrange],
# '-.', use_line_collection=True)
# '-.')
# plt.setp(baseline, 'linewidth', 0)
# plt.setp(stemlines, 'color', 'b')
# plt.setp(markerline, 'markerfacecolor', 'b', 'markeredgecolor', 'b')
Expand All @@ -371,7 +371,7 @@ def mpl_plot(
fig2, ax = plt.subplots(num="Antenna parameters", figsize=(20, 12), facecolor="w", edgecolor="w")
gs2 = gridspec.GridSpec(2, 2, hspace=0.3)
ax = plt.subplot(gs2[0, 0])
markerline, stemlines, baseline = ax.stem(freqs[pltrange], s11[pltrange], "-.", use_line_collection=True)
markerline, stemlines, baseline = ax.stem(freqs[pltrange], s11[pltrange], "-.")
plt.setp(baseline, "linewidth", 0)
plt.setp(stemlines, "color", "g")
plt.setp(markerline, "markerfacecolor", "g", "markeredgecolor", "g")
Expand All @@ -386,7 +386,7 @@ def mpl_plot(
# Plot frequency spectra of s21
if s21 is not None:
ax = plt.subplot(gs2[0, 1])
markerline, stemlines, baseline = ax.stem(freqs[pltrange], s21[pltrange], "-.", use_line_collection=True)
markerline, stemlines, baseline = ax.stem(freqs[pltrange], s21[pltrange], "-.")
plt.setp(baseline, "linewidth", 0)
plt.setp(stemlines, "color", "g")
plt.setp(markerline, "markerfacecolor", "g", "markeredgecolor", "g")
Expand All @@ -400,7 +400,7 @@ def mpl_plot(

# Plot input resistance (real part of impedance)
ax = plt.subplot(gs2[1, 0])
markerline, stemlines, baseline = ax.stem(freqs[pltrange], zin[pltrange].real, "-.", use_line_collection=True)
markerline, stemlines, baseline = ax.stem(freqs[pltrange], zin[pltrange].real, "-.")
plt.setp(baseline, "linewidth", 0)
plt.setp(stemlines, "color", "g")
plt.setp(markerline, "markerfacecolor", "g", "markeredgecolor", "g")
Expand All @@ -415,7 +415,7 @@ def mpl_plot(

# Plot input reactance (imaginery part of impedance)
ax = plt.subplot(gs2[1, 1])
markerline, stemlines, baseline = ax.stem(freqs[pltrange], zin[pltrange].imag, "-.", use_line_collection=True)
markerline, stemlines, baseline = ax.stem(freqs[pltrange], zin[pltrange].imag, "-.")
plt.setp(baseline, "linewidth", 0)
plt.setp(stemlines, "color", "g")
plt.setp(markerline, "markerfacecolor", "g", "markeredgecolor", "g")
Expand All @@ -430,7 +430,7 @@ def mpl_plot(
# Plot input admittance (magnitude)
# ax = plt.subplot(gs2[2, 0])
# markerline, stemlines, baseline = ax.stem(freqs[pltrange], np.abs(yin[pltrange]),
# '-.', use_line_collection=True)
# '-.')
# plt.setp(baseline, 'linewidth', 0)
# plt.setp(stemlines, 'color', 'g')
# plt.setp(markerline, 'markerfacecolor', 'g', 'markeredgecolor', 'g')
Expand All @@ -445,7 +445,7 @@ def mpl_plot(
# Plot input admittance (phase)
# ax = plt.subplot(gs2[2, 1])
# markerline, stemlines, baseline = ax.stem(freqs[pltrange], np.angle(yin[pltrange], deg=True),
# '-.', use_line_collection=True)
# '-.')
# plt.setp(baseline, 'linewidth', 0)
# plt.setp(stemlines, 'color', 'g')
# plt.setp(markerline, 'markerfacecolor', 'g', 'markeredgecolor', 'g')
Expand Down
2 changes: 1 addition & 1 deletion toolboxes/Plotting/plot_source_wave.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def mpl_plot(w, timewindow, dt, iterations, fft=False, save=False):
ax1.set_ylabel("Amplitude")

# Plot frequency spectra
markerline, stemlines, baseline = ax2.stem(freqs[pltrange], power[pltrange], "-.", use_line_collection=True)
markerline, stemlines, baseline = ax2.stem(freqs[pltrange], power[pltrange], "-.")
plt.setp(baseline, "linewidth", 0)
plt.setp(stemlines, "color", "r")
plt.setp(markerline, "markerfacecolor", "r", "markeredgecolor", "r")
Expand Down

0 comments on commit 4d5afa8

Please sign in to comment.