日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > python >内容正文

python

python三维数据图_matplotlib中三维数据的热图

發(fā)布時間:2023/12/1 python 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python三维数据图_matplotlib中三维数据的热图 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

我想用我的三維數(shù)據(jù)生成一張熱圖。在

我已經(jīng)能夠用這些數(shù)據(jù)繪制出trisurf。在

有人能幫我制作熱圖嗎?我看到了在線教程,但是它們對3D來說都很復(fù)雜,我在這個網(wǎng)站上找到了一個在matplotlib中生成帶有散點的熱圖,但是它只有2D數(shù)據(jù)。在

我生成trisurf的代碼是from mpl_toolkits.mplot3d import Axes3D

from matplotlib import cm

import matplotlib.pyplot as plt

import numpy as np

n_angles = 36

n_radii = 8

# An array of radii

# Does not include radius r=0, this is to eliminate duplicate points

radii = np.linspace(0.125, 1.0, n_radii)

# An array of angles

angles = np.linspace(0, 2*np.pi, n_angles, endpoint=False)

# Repeat all angles for each radius

angles = np.repeat(angles[...,np.newaxis], n_radii, axis=1)

# Convert polar (radii, angles) coords to cartesian (x, y) coords

# (0, 0) is added here. There are no duplicate points in the (x, y) plane

x,y,z =np.loadtxt('output/flash_KR_endowment_duration_3D.dat',delimiter='\t',usecols=(0,1,2),unpack=True)

#x,y,z =np.loadtxt('output/disk_KR_endowment_duration_3D.dat',delimiter='\t',usecols=(0,1,2),unpack=True)

fig = plt.figure()

ax = fig.gca(projection='3d')

#fig.suptitle(suptitle, fontsize=12, fontweight='bold')

#ax.set_title("Disk Kryder's Rate-Endowment-Duration Plot",fontsize=12)

ax.set_title("Flash Kryder's Rate-Endowment-Duration Plot",fontsize=12)

ax.set_xlabel("Kryder's rate")

ax.set_ylabel("Duration")

ax.set_zlabel("Endowment")

surf = ax.plot_trisurf(x, y, z, cmap=cm.jet, linewidth=0.2)

fig.colorbar(surf, shrink=.7, aspect=20)

plt.show()

數(shù)據(jù)為3列。比如說X,Y,Z。我試過用顏色繪制三維散點圖。但我在找熱圖。在

總結(jié)

以上是生活随笔為你收集整理的python三维数据图_matplotlib中三维数据的热图的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。