2
私はマットショーのスケールバーを見たいと思っています。私はかなり長い時間を探して答えを見つけられませんでした。それ、どうやったら出来るの?matshowでスケールバーを見るにはどうすればいいですか?
コードは非常に簡単です:私の知る限りscale barはmatplotlibののネイティブ機能の一部ではありません知っているよう
def analyze_results():
l_points = [np.array([10, 9, -1]), np.array([-4, 4, 1]), np.array([-6, 2, -1]), np.array([ 7, -2, 1]), np.array([-3, 2, -1]), np.array([ 3, -5, -1]), np.array([-5, 10, 1]), np.array([-10, 9, -1]), np.array([ 4, -4, 1]), np.array([-4, 7, 1])]
num_elemnts = 2 * const_limit + 1
loss = np.zeros((num_elemnts, num_elemnts))
for i in range(-const_limit, const_limit + 1):
for j in range(-const_limit, const_limit + 1):
if ((i == 0) & (j == 0)):
continue
w = (i, j)
loss[i, j] , _ = gradient_hinge_loss(l_points, w)
return loss
if __name__ == '__main__':
loss_hinge_debugger = analyze_results()
plt.matshow(loss_hinge_debugger)
plt.show()
これは10倍です –