# -*- coding: utf-8 -*-
"""
Created on Sun Oct 23 13:57:22 2022
@author: Lenovo
"""
import seaborn as sns
from scipy.stats import pearsonr
import matplotlib as mpl
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import gaussian_kde
from mpl_toolkits.axes_grid1 import make_axes_locatable
plt.rcParams['savefig.dpi'] = 600 #图片像素
plt.rcParams['figure.dpi'] = 600
path = r'D:\河北省土地利用\19901'
for lujing ,year in zip(os.listdir(path),[1990,1999,2004,2009,2014,2019]):
p = pd.read_csv(os.path.join(path,lujing))
print(p.columns)
p = p[['MEAN','MEAN_1','MEAN_12', 'MEAN_12_13']]
p0 = p.loc[p['MEAN_1']>=0,['MEAN','MEAN_1']]
p0['MEAN']=[x/100-273 for x in p0['MEAN']]
p0 = p0.reset_index(drop=True)
p1 = p.loc[p['MEAN_12']>=0,['MEAN','MEAN_12']]
p1['MEAN']=[x/100-273 for x in p1['MEAN']]
p1 = p1.reset_index(drop=True)
p2 = p.loc[p['MEAN_12_13']>=0,['MEAN','MEAN_12_13']]
p2['MEAN']=[x/100-273 for x in p2['MEAN']]
p2 = p2.reset_index(drop=True)
x = p0['MEAN_1']
y = p0['MEAN']
x1 = p1['MEAN_12']
y1 = p1['MEAN']
x2 = p2['MEAN_12_13']
y2 = p2['MEAN']
plt.figure(figsize
【组合图【核密度散点图+热力图】1*3】
最新推荐文章于 2024-02-22 17:17:16 发布
本文介绍了如何使用Python进行数据可视化,通过结合核密度散点图和热力图,实现1*3的组合图表展示。内容涵盖了matplotlib和seaborn库的使用技巧,为机器学习项目的探索性数据分析提供有效工具。
摘要由CSDN通过智能技术生成