2
バックグラウンドデータとフィット線で半ログプロットを作成しようとすると、フィット線が完全に曇ったように見える。ログスケール線が塗りつぶされている、半円のように見える
import numpy as np
import matplotlib.pyplot as plt
k=0
for i in np.arange(0,len(emceeredshifts),7):
zbin=emceeredshifts[i+1]
lowradius = radius[(redshift <= (zbin + halfwidth)) & (redshift >= (zbin - halfwidth)) & (radius > 1) & (radius<20) &(mass>10.5)].flatten()
lowmass = mass[(redshift <= (zbin + halfwidth)) & (redshift >= (zbin - halfwidth)) & (radius > 1) & (radius<20)&(mass>10.5)].flatten()
if len(lowradius)>0:
lowfit = np.polyfit(lowmass, lowradius, 1)
lowlin,lowinter=np.poly1d(lowfit)
lowbestfit = lowinter + lowlin * (lowmass)
plt.plot(lowmass, lowbestfit, color=rainbowcolors[k], label=str(zbin))
plt.scatter(lowmass, lowradius, color=rainbowcolors[k], marker='.', alpha=.2, edgecolor='none')
k+=1
plt.legend(loc='lower right')
plt.title("Galaxy radius vs mass\nlinear mcmc mass predictions")
plt.xlabel("Log $M_\odot$")
plt.ylabel("Physical radius (kpc)")
plt.ylim(2,15)
plt.xlim(10.6,11.8)
plt.yscale('log')
plt.show()
ここではバグの半ログ結果を示します。
ログスケールを削除すると、次のようになります。 y軸が線形の場合、線は線のように見え、データはデータのように見えます。
何が問題になりますか?