小编Sim*_*mon的帖子

没有边框的python matplotlib表

我在下面的示例生成的表格上有一个绘图.表格数据被随机数替换,实际图表被一些仲裁函数取代:

import numpy as np
import matplotlib.pylab as plt

fig, ax = plt.subplots()

ntp = 17 # number of peak periods
nhs = 30 # number of wave heights

scatter_table = np.random.randint(0,10,(nhs,ntp)) # wave scatter diagram

tp = np.linspace(3,20,ntp+1) # peak period array
hs = np.linspace(0,15,nhs+1) # significant wave height

# axis limits to be in line with scatter diagram
ax.set_xlim((min(tp),max(tp)))
ax.set_ylim((min(hs),max(hs)))

# axis ticks as per scatter table bins
ax.set_xticks(tp)
ax.set_yticks(hs)

# matplotlib table
the_table = plt.table(cellText=scatter_table,loc=(0,0),cellLoc='center')

# change …
Run Code Online (Sandbox Code Playgroud)

python matplotlib

3
推荐指数
1
解决办法
3664
查看次数

标签 统计

matplotlib ×1

python ×1