Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
プロットの他の部分とは異なるカラーバーの目盛りラベルフォントを使用したいとします。どうすればいいですか?
matplotlib について話していると仮定すると、すべての目盛りラベルを反復処理し、フォント ファミリを設定します。
import numpy as np import matplotlib.pyplot as plt plt.imshow(np.random.random((10,10))) cb = plt.colorbar() for l in cb.ax.yaxis.get_ticklabels(): l.set_family("Comic Sans MS") plt.show()