如何使用 matplotlib.pyplot 更改圖例大小 - How to change legend size with matplotlib.pyplot

問題:

Simple question here: I'm trying to get the size of my legend using matplotlib.pyplot to be smaller (ie, the text to be smaller).這裏有一個簡單的問題:我試圖使用matplotlib.pyplot使我的圖例的大小變小(即,文本變小)。 The code I'm using goes something like this:我使用的代碼是這樣的:

plot.figure()
plot.scatter(k, sum_cf, color='black', label='Sum of Cause Fractions')
plot.scatter(k, data[:, 0],  color='b', label='Dis 1: cf = .6, var = .2')
plot.scatter(k, data[:, 1],  color='r',  label='Dis 2: cf = .2, var = .1')
plot.scatter(k, data[:, 2],  color='g', label='Dis 3: cf = .1, var = .01')
plot.legend(loc=2)

解決方案:

參考一: https://stackoom.com/question/TtXV
參考二: How to change legend size with matplotlib.pyplot
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章