Tweaks to gridline styles.

这个提交包含在:
Craig Warren
2018-05-02 14:28:38 +01:00
父节点 4118604112
当前提交 cc33a628b6
共有 4 个文件被更改,包括 28 次插入24 次删除

查看文件

@@ -103,7 +103,7 @@ def mpl_plot(filename, outputs=Rx.defaultoutputs, fft=False):
ax1.set_xlabel('Time [s]') ax1.set_xlabel('Time [s]')
ax1.set_ylabel(outputtext + ' field strength [V/m]') ax1.set_ylabel(outputtext + ' field strength [V/m]')
ax1.set_xlim([0, np.amax(time)]) ax1.set_xlim([0, np.amax(time)])
ax1.grid() ax1.grid(which='both', axis='both', linestyle='-.')
# Plot frequency spectra # Plot frequency spectra
markerline, stemlines, baseline = ax2.stem(freqs[pltrange], power[pltrange], '-.') markerline, stemlines, baseline = ax2.stem(freqs[pltrange], power[pltrange], '-.')
@@ -113,7 +113,7 @@ def mpl_plot(filename, outputs=Rx.defaultoutputs, fft=False):
line2 = ax2.plot(freqs[pltrange], power[pltrange], 'r', lw=2) line2 = ax2.plot(freqs[pltrange], power[pltrange], 'r', lw=2)
ax2.set_xlabel('Frequency [Hz]') ax2.set_xlabel('Frequency [Hz]')
ax2.set_ylabel('Power [dB]') ax2.set_ylabel('Power [dB]')
ax2.grid() ax2.grid(which='both', axis='both', linestyle='-.')
# Change colours and labels for magnetic field components or currents # Change colours and labels for magnetic field components or currents
if 'H' in outputs[0]: if 'H' in outputs[0]:
@@ -137,7 +137,7 @@ def mpl_plot(filename, outputs=Rx.defaultoutputs, fft=False):
line = ax.plot(time, outputdata, 'r', lw=2, label=outputtext) line = ax.plot(time, outputdata, 'r', lw=2, label=outputtext)
ax.set_xlim([0, np.amax(time)]) ax.set_xlim([0, np.amax(time)])
# ax.set_ylim([-15, 20]) # ax.set_ylim([-15, 20])
ax.grid() ax.grid(which='both', axis='both', linestyle='-.')
if 'H' in output: if 'H' in output:
plt.setp(line, color='g') plt.setp(line, color='g')
@@ -214,7 +214,7 @@ def mpl_plot(filename, outputs=Rx.defaultoutputs, fft=False):
ax.set_ylabel(outputtext + ', current [A]') ax.set_ylabel(outputtext + ', current [A]')
for ax in fig.axes: for ax in fig.axes:
ax.set_xlim([0, np.amax(time)]) ax.set_xlim([0, np.amax(time)])
ax.grid() ax.grid(which='both', axis='both', linestyle='-.')
# Save a PDF/PNG of the figure # Save a PDF/PNG of the figure
# fig.savefig(os.path.splitext(os.path.abspath(filename))[0] + '_rx' + str(rx) + '.pdf', dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1) # fig.savefig(os.path.splitext(os.path.abspath(filename))[0] + '_rx' + str(rx) + '.pdf', dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1)

查看文件

@@ -49,7 +49,11 @@ def mpl_plot(filename, outputdata, dt, rxnumber, rxcomponent):
plt.xlabel('Trace number') plt.xlabel('Trace number')
plt.ylabel('Time [s]') plt.ylabel('Time [s]')
# plt.title('{}'.format(filename)) # plt.title('{}'.format(filename))
plt.grid()
# Grid properties
ax = fig.gca()
ax.grid(which='both', axis='both', linestyle='-.')
cb = plt.colorbar() cb = plt.colorbar()
if 'E' in rxcomponent: if 'E' in rxcomponent:
cb.set_label('Field strength [V/m]') cb.set_label('Field strength [V/m]')

查看文件

@@ -188,7 +188,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
ax.set_xlabel('Time [s]') ax.set_xlabel('Time [s]')
ax.set_ylabel('Voltage [V]') ax.set_ylabel('Voltage [V]')
ax.set_xlim([0, np.amax(time)]) ax.set_xlim([0, np.amax(time)])
ax.grid() ax.grid(which='both', axis='both', linestyle='-.')
# Plot frequency spectra of incident voltage # Plot frequency spectra of incident voltage
ax = plt.subplot(gs1[0, 1]) ax = plt.subplot(gs1[0, 1])
@@ -200,7 +200,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
ax.set_title('Incident voltage') ax.set_title('Incident voltage')
ax.set_xlabel('Frequency [Hz]') ax.set_xlabel('Frequency [Hz]')
ax.set_ylabel('Power [dB]') ax.set_ylabel('Power [dB]')
ax.grid() ax.grid(which='both', axis='both', linestyle='-.')
# Plot incident current # Plot incident current
ax = plt.subplot(gs1[1, 0]) ax = plt.subplot(gs1[1, 0])
@@ -209,7 +209,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
ax.set_xlabel('Time [s]') ax.set_xlabel('Time [s]')
ax.set_ylabel('Current [A]') ax.set_ylabel('Current [A]')
ax.set_xlim([0, np.amax(time)]) ax.set_xlim([0, np.amax(time)])
ax.grid() ax.grid(which='both', axis='both', linestyle='-.')
# Plot frequency spectra of incident current # Plot frequency spectra of incident current
ax = plt.subplot(gs1[1, 1]) ax = plt.subplot(gs1[1, 1])
@@ -221,7 +221,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
ax.set_title('Incident current') ax.set_title('Incident current')
ax.set_xlabel('Frequency [Hz]') ax.set_xlabel('Frequency [Hz]')
ax.set_ylabel('Power [dB]') ax.set_ylabel('Power [dB]')
ax.grid() ax.grid(which='both', axis='both', linestyle='-.')
# Plot total voltage # Plot total voltage
ax = plt.subplot(gs1[2, 0]) ax = plt.subplot(gs1[2, 0])
@@ -230,7 +230,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
ax.set_xlabel('Time [s]') ax.set_xlabel('Time [s]')
ax.set_ylabel('Voltage [V]') ax.set_ylabel('Voltage [V]')
ax.set_xlim([0, np.amax(time)]) ax.set_xlim([0, np.amax(time)])
ax.grid() ax.grid(which='both', axis='both', linestyle='-.')
# Plot frequency spectra of total voltage # Plot frequency spectra of total voltage
ax = plt.subplot(gs1[2, 1]) ax = plt.subplot(gs1[2, 1])
@@ -242,7 +242,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
ax.set_title('Total (incident + reflected) voltage') ax.set_title('Total (incident + reflected) voltage')
ax.set_xlabel('Frequency [Hz]') ax.set_xlabel('Frequency [Hz]')
ax.set_ylabel('Power [dB]') ax.set_ylabel('Power [dB]')
ax.grid() ax.grid(which='both', axis='both', linestyle='-.')
# Plot total current # Plot total current
ax = plt.subplot(gs1[3, 0]) ax = plt.subplot(gs1[3, 0])
@@ -251,7 +251,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
ax.set_xlabel('Time [s]') ax.set_xlabel('Time [s]')
ax.set_ylabel('Current [A]') ax.set_ylabel('Current [A]')
ax.set_xlim([0, np.amax(time)]) ax.set_xlim([0, np.amax(time)])
ax.grid() ax.grid(which='both', axis='both', linestyle='-.')
# Plot frequency spectra of total current # Plot frequency spectra of total current
ax = plt.subplot(gs1[3, 1]) ax = plt.subplot(gs1[3, 1])
@@ -263,7 +263,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
ax.set_title('Total (incident + reflected) current') ax.set_title('Total (incident + reflected) current')
ax.set_xlabel('Frequency [Hz]') ax.set_xlabel('Frequency [Hz]')
ax.set_ylabel('Power [dB]') ax.set_ylabel('Power [dB]')
ax.grid() ax.grid(which='both', axis='both', linestyle='-.')
# Plot reflected (reflected) voltage # Plot reflected (reflected) voltage
# ax = plt.subplot(gs1[4, 0]) # ax = plt.subplot(gs1[4, 0])
@@ -272,7 +272,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
# ax.set_xlabel('Time [s]') # ax.set_xlabel('Time [s]')
# ax.set_ylabel('Voltage [V]') # ax.set_ylabel('Voltage [V]')
# ax.set_xlim([0, np.amax(time)]) # ax.set_xlim([0, np.amax(time)])
# ax.grid() # ax.grid(which='both', axis='both', linestyle='-.')
# Plot frequency spectra of reflected voltage # Plot frequency spectra of reflected voltage
# ax = plt.subplot(gs1[4, 1]) # ax = plt.subplot(gs1[4, 1])
@@ -284,7 +284,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
# ax.set_title('Reflected voltage') # ax.set_title('Reflected voltage')
# ax.set_xlabel('Frequency [Hz]') # ax.set_xlabel('Frequency [Hz]')
# ax.set_ylabel('Power [dB]') # ax.set_ylabel('Power [dB]')
# ax.grid() # ax.grid(which='both', axis='both', linestyle='-.')
# Plot reflected (reflected) current # Plot reflected (reflected) current
# ax = plt.subplot(gs1[5, 0]) # ax = plt.subplot(gs1[5, 0])
@@ -293,7 +293,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
# ax.set_xlabel('Time [s]') # ax.set_xlabel('Time [s]')
# ax.set_ylabel('Current [A]') # ax.set_ylabel('Current [A]')
# ax.set_xlim([0, np.amax(time)]) # ax.set_xlim([0, np.amax(time)])
# ax.grid() # ax.grid(which='both', axis='both', linestyle='-.')
# Plot frequency spectra of reflected current # Plot frequency spectra of reflected current
# ax = plt.subplot(gs1[5, 1]) # ax = plt.subplot(gs1[5, 1])
@@ -305,7 +305,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
# ax.set_title('Reflected current') # ax.set_title('Reflected current')
# ax.set_xlabel('Frequency [Hz]') # ax.set_xlabel('Frequency [Hz]')
# ax.set_ylabel('Power [dB]') # ax.set_ylabel('Power [dB]')
# ax.grid() # ax.grid(which='both', axis='both', linestyle='-.')
# Figure 2 # Figure 2
# Plot frequency spectra of s11 # Plot frequency spectra of s11
@@ -322,7 +322,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
ax.set_ylabel('Power [dB]') ax.set_ylabel('Power [dB]')
# ax.set_xlim([0, 5e9]) # ax.set_xlim([0, 5e9])
# ax.set_ylim([-25, 0]) # ax.set_ylim([-25, 0])
ax.grid() ax.grid(which='both', axis='both', linestyle='-.')
# Plot frequency spectra of s21 # Plot frequency spectra of s21
if s21 is not None: if s21 is not None:
@@ -337,7 +337,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
ax.set_ylabel('Power [dB]') ax.set_ylabel('Power [dB]')
# ax.set_xlim([0.88e9, 1.02e9]) # ax.set_xlim([0.88e9, 1.02e9])
# ax.set_ylim([-25, 50]) # ax.set_ylim([-25, 50])
ax.grid() ax.grid(which='both', axis='both', linestyle='-.')
# Plot input resistance (real part of impedance) # Plot input resistance (real part of impedance)
ax = plt.subplot(gs2[1, 0]) ax = plt.subplot(gs2[1, 0])
@@ -352,7 +352,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
# ax.set_xlim([0.88e9, 1.02e9]) # ax.set_xlim([0.88e9, 1.02e9])
ax.set_ylim(bottom=0) ax.set_ylim(bottom=0)
# ax.set_ylim([0, 300]) # ax.set_ylim([0, 300])
ax.grid() ax.grid(which='both', axis='both', linestyle='-.')
# Plot input reactance (imaginery part of impedance) # Plot input reactance (imaginery part of impedance)
ax = plt.subplot(gs2[1, 1]) ax = plt.subplot(gs2[1, 1])
@@ -366,7 +366,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
ax.set_ylabel('Reactance [Ohms]') ax.set_ylabel('Reactance [Ohms]')
# ax.set_xlim([0.88e9, 1.02e9]) # ax.set_xlim([0.88e9, 1.02e9])
# ax.set_ylim([-300, 300]) # ax.set_ylim([-300, 300])
ax.grid() ax.grid(which='both', axis='both', linestyle='-.')
# Plot input admittance (magnitude) # Plot input admittance (magnitude)
# ax = plt.subplot(gs2[2, 0]) # ax = plt.subplot(gs2[2, 0])
@@ -380,7 +380,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
# ax.set_ylabel('Admittance [Siemens]') # ax.set_ylabel('Admittance [Siemens]')
# ax.set_xlim([0.88e9, 1.02e9]) # ax.set_xlim([0.88e9, 1.02e9])
# ax.set_ylim([0, 0.035]) # ax.set_ylim([0, 0.035])
# ax.grid() # ax.grid(which='both', axis='both', linestyle='-.')
# Plot input admittance (phase) # Plot input admittance (phase)
# ax = plt.subplot(gs2[2, 1]) # ax = plt.subplot(gs2[2, 1])
@@ -394,7 +394,7 @@ def mpl_plot(filename, time, freqs, Vinc, Vincp, Iinc, Iincp, Vref, Vrefp, Iref,
# ax.set_ylabel('Phase [degrees]') # ax.set_ylabel('Phase [degrees]')
# ax.set_xlim([0.88e9, 1.02e9]) # ax.set_xlim([0.88e9, 1.02e9])
# ax.set_ylim([-40, 100]) # ax.set_ylim([-40, 100])
# ax.grid() # ax.grid(which='both', axis='both', linestyle='-.')
# Save a PDF/PNG of the figure # Save a PDF/PNG of the figure
# fig1.savefig(os.path.splitext(os.path.abspath(filename))[0] + '_tl_params.png', dpi=150, format='png', bbox_inches='tight', pad_inches=0.1) # fig1.savefig(os.path.splitext(os.path.abspath(filename))[0] + '_tl_params.png', dpi=150, format='png', bbox_inches='tight', pad_inches=0.1)

查看文件

@@ -136,7 +136,7 @@ def mpl_plot(w, timewindow, dt, iterations, fft=False):
ax1.set_xlabel('Time [s]') ax1.set_xlabel('Time [s]')
ax1.set_ylabel('Amplitude') ax1.set_ylabel('Amplitude')
[ax.grid() for ax in fig.axes] # Turn on grid [ax.grid(which='both', axis='both', linestyle='-.') for ax in fig.axes] # Turn on grid
# Save a PDF/PNG of the figure # Save a PDF/PNG of the figure
# fig.savefig(os.path.dirname(os.path.abspath(__file__)) + os.sep + w.type + '.pdf', dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1) # fig.savefig(os.path.dirname(os.path.abspath(__file__)) + os.sep + w.type + '.pdf', dpi=None, format='pdf', bbox_inches='tight', pad_inches=0.1)