数据可视化matplotlib、seaborn、pydotplus
如需转发,请注明出处: 小婷儿的python https://www.cnblogs.com/xxtalhr/p/10486560.html 一、数据可视化 data.mat 链接: https://pan.baidu.com/s/1XMi-71QzlzkGppN17AS1bw 提取码:uddg 方法一 import matplotlib.pyplot as plt import seaborn as sns import pandas as pd import scipy.io as sio #导入数据 mat = sio.loadmat( '../data.mat' ) mat.keys() data1 = pd.DataFrame(mat.get( 'X' ), columns=[ 'X1' , 'X2' ]) data1.head() fig, ax = plt.subplots(figsize=( 12 , 8 )) ax.scatter(data1[ 'X1' ],data1[ 'X2' ]) plt.show() 方法二 plt.figure(figsize=(12,8)) plt.scatter(data1[ 'X1' ],data1[ 'X2' ]) plt.show() 方法三 sns.lmplot( 'X1' , 'X2' , data=data1, fit