1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/nanxun-pythonshujukeshihuajiantu

Клонировать/Скачать
图例.py 462 Байты
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
nanxun Отправлено 05.07.2017 09:22 cf2f5f0
#coding:utf-8
import matplotlib.pyplot as plt
import numpy as np
x=np.arange(1,11,1)
fig=plt.figure()
ax1=fig.add_subplot(111)
ax1.plot(x,x*2,label="Normal",c='g')
ax1.plot(x,x*3,label="Fast",c='k')
ax1.plot(x,x*5,label="Faster",c='r')
'''
label可以写在legend里面ax1.legend("","","")
legend 显示图例
loc 位置参数 0best(自适应最好的位置) 1右上 2左上 3左下 4右下......--10
ncol 有几列
'''
ax1.legend(loc=1,ncol=3)
plt.show()

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/nanxun-pythonshujukeshihuajiantu.git
git@api.gitlife.ru:oschina-mirror/nanxun-pythonshujukeshihuajiantu.git
oschina-mirror
nanxun-pythonshujukeshihuajiantu
nanxun-pythonshujukeshihuajiantu
master