可视化
castingA3T
这个作者很懒,什么都没留下…
展开
-
matplotlib条形图
from matplotlib import pyplot as plt import numpy as np fig=plt.figure() ax=fig.add_subplot(111) x=np.arange(4) data=np.array([15,20,18,25]) rect=ax.bar(x,data,width=0.5,color="lightblue") for rec in r原创 2017-12-31 10:48:39 · 357 阅读 · 0 评论 -
scatter绘制散点图
import numpy as np import matplotlib.pyplot as plt x = np.arange(1,10) y = x fig = plt.figure() ax1 = fig.add_subplot(111) ax1.set_title('Scatter Plot') plt.xlabel('X') plt.ylabel('Y')原创 2017-12-26 13:04:36 · 2573 阅读 · 0 评论 -
matplotlib绘制sin、cos曲线
import numpy as np import matplotlib.pyplot as plt plt.rcParams['font.sans-serif']=['SimHei']#用来正常显示中文标签 plt.rcParams['axes.unicode_minus']=False#用来正常显示负号x = np.linspace(0, 10, 1000) y = np.sin(x) + 1原创 2017-12-29 21:02:24 · 9822 阅读 · 0 评论 -
matplotlib箱形图
seed()用法 import numpy as np np.random.seed()#seed()随机数变化,seed(2)#里面有数字,数字不变,随机数不变 a=np.random.randn(5,4) In [26]:a Out[26]: array([[ 0.17835632, 0.28546591, 0.65957699, -0.3424716 ], [ 1.3原创 2018-01-06 21:56:15 · 1680 阅读 · 0 评论 -
matplotlib饼状图
import matplotlib.pyplot as plt labels = 'Frogs','Hogs','Dogs','Logs' sizes = [15,30,45,10] explode = [0,0.1,0,0] #0.1表示将Hogs那一块凸显出来 plt.pie(sizes,explode=explode,labels=labels,autopct='%1.1f%%',原创 2018-01-06 23:42:34 · 748 阅读 · 0 评论 -
误差条形图
import numpy as np import pandas as pd import matplotlib.pyplot as plt plt.rcParams['font.sans-serif']=['SimHei']#用来正常显示中文标签 plt.rcParams['axes.unicode_minus']=False#用来正常显示负号 x=[0,1,2,3,4] y=[5,3,6,原创 2018-01-31 16:55:57 · 6332 阅读 · 0 评论