小编svi*_*ter的帖子

如何将matplotlib.pyplot.contourf的结果放入圆圈?

这是我绘制一些数据的代码:

from scipy.interpolate import griddata
from numpy import linspace
import matplotlib.pyplot as plt
meanR = [9.95184937,   9.87947708,   9.87628496,   9.78414422,
         9.79365258,   9.96168969,   9.87537519,   9.74536093,
        10.16686878,  10.04425475,  10.10444126,  10.2917172 ,
        10.16745917,  10.0235203 ,   9.89914   ,  10.11263505,
         9.99756449,  10.17861254,  10.04704248]
koord = [[1,4],[3,4],[1,3],[3,3],[2,3],[1,2],[3,2],[2,2],[1,1],[3,1],[2,1],[1,0],[3,0],[0,3],[4,3],[0,2],[4,2],[0,1],[4,1]]
x,y=[],[]
for i in koord:
    x.append(i[0])
    y.append(i[1])
z = meanR
xi = linspace(-2,6,300);
yi = linspace(-2,6,300);
zi = griddata((x, y), z, (xi[None,:], yi[:,None]), method='cubic')
CS = plt.contourf(xi,yi,zi,15,cmap=plt.cm.jet)
plt.scatter(x,y,marker='o',c='b',s=15)
plt.xlim(min(x),max(x))
plt.ylim(min(y),max(y))
plt.show() 
Run Code Online (Sandbox Code Playgroud)

结果我们有:

在此输入图像描述

我怎么能把它刻在一个圆圈里?这样的事情在此输入图像描述

python matplotlib contour

9
推荐指数
1
解决办法
3714
查看次数

如何从"summary.glht"中提取p值

我想从Pr(> | t |)列中提取值

library(lsmeans)    
warp.lm = lm(breaks ~ wool * tension, data = warpbreaks)
toP<-lsmeans(warp.lm, pairwise ~ wool | tension, glhargs=list())
toP[[2]]

         Simultaneous Tests for General Linear Hypotheses

Fit: lm(formula = breaks ~ wool * tension, data = warpbreaks)

Linear Hypotheses:
               Estimate Std. Error t value Pr(>|t|)   
A - B | L == 0   16.333      5.157   3.167  0.00797 **
A - B | M == 0   -4.778      5.157  -0.926  0.73187   
A - B | H == 0    5.778      5.157 …
Run Code Online (Sandbox Code Playgroud)

r

5
推荐指数
1
解决办法
4002
查看次数

标签 统计

contour ×1

matplotlib ×1

python ×1

r ×1