def plot(self, save_path_png='SNR_EVM.png', save_path_pdf='SNR_EVM.pdf'):
fig, ax = plt.subplots(
figsize=(self.format.figSizeX, self.format.figSizeY))
ax.set_position((self.format.axPosX, self.format.axPosY,
self.format.axSizeX, self.format.axSizeY))
for idx, modu in enumerate(self.modu_list):
snr_list = self.snr_mat[idx]
evm_list = self.evm_mat[idx]
assert len(snr_list) == len(evm_list)
ax.plot(snr_list, evm_list,
color=self.format.colorList[idx],
linewidth=self.format.lineWidth, linestyle=self.format.lineStyleList[0],
marker=self.format.markerList[idx], markersize=self.format.markerSizeList[1]*0.8,
markerfacecolor='none', label=modu, zorder=3)
ax.plot(snr_list, evm_list,
color=self.format.colorList[idx], alpha=0.5,
marker=self.format.markerList[idx], markersize=self.format.markerSizeList[1]*0.8,
markerfacecolor=self.format.colorList[idx], zorder=3)
ax.grid(zorder=0)
ax.set_xlabel('SNR (dB)', fontsize=self.format.fontLabel)
ax.set_xticks([0, 10, 20, 30, 40])
ax.set_xticklabels([0, 10, 20, 30, 40], fontsize=self.format.fontTick)
ax.set_xlim(left=0, right=40)
ax.set_ylabel('EVM (%)', fontsize=self.format.fontLabel)
ax.set_yticks([0, 0.1, 0.2, 0.3, 0.4, 0.5])
ax.set_yticklabels(['0', '10', '20', '30', '40', '50'],
fontsize=self.format.fontTick)
ax.set_ylim(bottom=0, top=0.5)
if self.auto_thres:
for idx, thres in enumerate(self.evm_thres):
ax.hlines(thres, xmin=-100, xmax=+100, linewidth=self.format.lineWidth, linestyle='dashed', color=self.format.colorList[idx], zorder=3)
else:
ax.hlines(self.thres, xmin=-100, xmax=+100, linewidth=self.format.lineWidth, linestyle='dashed', color='tab:gray', zorder=3)
for spine in ax.spines.values():
spine.set_linewidth(self.format.lineWidth)
fig.savefig(save_path_png, format='png', dpi=1200)
# fig.savefig(save_path_pdf, format='pdf')
plt.close(fig)