소스 뷰어
# PSNR
import numpy as np
from matplotlib import pyplot as plt
row_cnt = 1; col_cnt=1
fig, charts = plt.subplots( row_cnt, col_cnt,figsize=(9*col_cnt, 5.8*row_cnt) )
charts = charts.flatten() if row_cnt*col_cnt >= 2 else [ charts ]
idx = 0
chart = charts[idx]
Ks = np.arange( 1, 7 + 1 , 2 )
x = Ks
t_20 = [ 21.330, 21.169, 21.172, 21.172 ]
t_40 = [ 23.177, 23.688, 23.678, 23.674 ]
t_60 = [ 23.772, 25.516, 25.542, 25.544 ]
chart.plot( x, t_20, marker="s", label="T=20" )
chart.plot( x, t_40, marker="s", label="T=40" )
chart.plot( x, t_60, marker="s", label="T=60" )
chart.set_title( "\nPSNR vs K \n" );
chart.set_xlabel( "\nK" )
chart.set_ylabel( "PSNR" )
chart.set_ylim( 0, 27 )
chart.legend()
plt.tight_layout(); plt.show()
# PSNR
import numpy as np
from matplotlib import pyplot as plt
row_cnt = 1; col_cnt=1
fig, charts = plt.subplots( row_cnt, col_cnt,figsize=(9*col_cnt, 5.8*row_cnt) )
charts = charts.flatten() if row_cnt*col_cnt >= 2 else [ charts ]
idx = 0
chart = charts[idx]
Os = np.array( [10, 20, 40, 60 ] )
x = Os
t_20 = [ 21.291, 23.357, 23.093, 21.399 ]
t_40 = [ 21.295, 23.733, 25.186, 26.380 ]
t_60 = [ 21.295, 23.763, 25.308, 26.779 ]
chart.plot( x, t_20, marker="s", label="T=20" )
chart.plot( x, t_40, marker="s", label="T=40" )
chart.plot( x, t_60, marker="s", label="T=60" )
chart.set_title( "\nPSNR vs Order \n" );
chart.set_xlabel( "\nOrder(n=m)" )
chart.set_ylabel( "PSNR" )
chart.set_ylim( 0, 27 )
chart.legend()
plt.tight_layout(); plt.show()