极地轮廓 2 的问题

时间:2021-05-04 12:20:21

标签: python arrays plot contour

我还有一个关于“极地轮廓”的问题。 我正在从 .csv 文件导入数据,需要制作平滑的极坐标轮廓。

我可以这样简化我的代码。

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import math

pi = math.pi
ang = pi / 4.0

theta_i = np.arange(pi/2, pi/2+(-ang*9), -ang)

temp = np.array([[0.9, 0.8, 0.7, 0.6, 0.5]   #These data varies w.r.t input data. It is just sample.
       ,[0.5, 0.8, 0.6, 0.6, 0.5]
       ,[0.7, 0.4, 0.7, 0.1, 1.0]
       ,[0.3, 0.3, 0.6, 0.3, 0.8]
       ,[0.4, 0.5, 0.5, 0.2, 0.6]
       ,[0.2, 0.6, 0.8, 0.4, 0.6]
       ,[0.1, 0.4, 0.8, 0.2, 0.7]
       ,[0.4, 0.5, 0.5, 0.5, 0.8]
       ,[0.8, 0.1, 0.5, 0.9, 0.7]])

r_j = []
r_j[:] = [0.2, 0.4, 0.4, 0.8, 1.0]   #These data varies w.r.t input data. It is just sample.

radii, theta = np.meshgrid(r_j, theta_i)
fig, ax = plt.subplots(subplot_kw = dict(projection = 'polar'))
ax.contourf(theta, radii, temp)
plt.axis([0, 2*pi, 0.0, 1.0])
plt.show()

在这种情况下,我得到了这个情节。 enter image description here

我的数据表的一种形式是... enter image description here

Q) 如何使极坐标轮廓更加平滑和完全填充? (没有外部空白区域) 我不能使用“linspace”。我认为,“插值”是必要的......但我不知道。

你能给我一个想法吗?

提前致谢!

0 个答案:

没有答案