def plot(self, save_path_png='SNR_BER.png', save_path_pdf='SNR_BER.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]
ber_list = [max(ber, 1e-6) for ber in self.ber_mat[idx]]
assert len(snr_list) == len(ber_list)
ax.plot(snr_list, ber_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, ber_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_yscale('log')
ax.set_ylabel('BER', fontsize=self.format.fontLabel)
ax.set_ylim(bottom=1e-5, top=0.5)
ax.set_yticks([1e-5, 1e-4, 1e-3, 1e-2, 1e-1])
ax.set_yticklabels(['$10^{-5}$', '$10^{-4}$', '$10^{-3}$', '$10^{-2}$', '$10^{-1}$'],
fontsize=self.format.fontTick - 5)
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)