python可视化(十种常用图)
python的可视化库(seaborn和matplotlib) 今天我将和大家一起入门这十种简单图的绘制 1.散点图 import numpy as np import pandas as pd import matplotlib . pyplot as plt import seaborn as sns # 数据准备 N = 1000 x = np . random . randn ( N ) y = np . random . randn ( N ) # 用Matplotlib画散点图 plt . scatter ( x , y , marker = 'x' ) plt . show ( ) # 用Seaborn画散点图 df = pd . DataFrame ( { 'x' : x , 'y' : y } ) sns . jointplot ( x = "x" , y = "y" , data = df , kind = 'scatter' ) ; plt . show ( ) 2.折线图 import pandas as pd import matplotlib . pyplot as plt import seaborn as sns # 数据准备 x = [ 2010 , 2011 , 2012 , 2013 , 2014 , 2015 , 2016 , 2017 ,