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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

JAVA定义一个多边形类_如何在每个数据类别中绘制多个多边形?

發布時間:2024/10/12 编程问答 46 豆豆
生活随笔 收集整理的這篇文章主要介紹了 JAVA定义一个多边形类_如何在每个数据类别中绘制多个多边形? 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一些代碼在SIBRE的捆綁演示數據集上執行此操作 .

在這個例子中,我們嘗試使用ggplot2創建后橢圓的多個樣本的一些圖 .

library(SIBER)

library(ggplot2)

library(dplyr)

library(ellipse)

使基本SIBER模型適合與包捆綁在一起的示例數據 .

# load in the included demonstration dataset

data("demo.siber.data")

#

# create the siber object

siber.example

# Calculate summary statistics for each group: TA, SEA and SEAc

group.ML

# options for running jags

parms

parms$n.iter

parms$n.burnin

parms$n.thin

parms$n.chains

# define the priors

priors

priors$R

priors$k

priors$tau.mu

# fit the ellipses which uses an Inverse Wishart prior

# on the covariance matrix Sigma, and a vague normal prior on the

# means. Fitting is via the JAGS method.

ellipses.posterior

# The posterior estimates of the ellipses for each group can be used to

# calculate the SEA.B for each group.

SEA.B

siberDensityPlot(SEA.B, xticklabels = colnames(group.ML),

xlab = c("Community | Group"),

ylab = expression("Standard Ellipse Area " ('\u2030' ^2) ),

bty = "L",

las = 1,

main = "SIBER ellipses on each group"

)

現在我們想要從這些分布中創建一些樣本橢圓的圖 . 我們需要為每個組創建所有省略號的data.frame對象 . 在這個例子中,我們簡單地將第10個后部繪制假設它們彼此獨立,但如果您愿意,可以隨機抽取樣本 .

# how many of the posterior draws do you want?

n.posts

# decide how big an ellipse you want to draw

p.ell

# for a standard ellipse use

# p.ell

# a list to store the results

all_ellipses

# loop over groups

for (i in 1:length(ellipses.posterior)){

# a dummy variable to build in the loop

ell

post.id

for ( j in 1:n.posts){

# covariance matrix

Sigma

# mean

mu

# ellipse points

out

ell

post.id

}

ell

ell$rep

all_ellipses[[i]]

}

ellipse_df

# now we need the group and community names

# extract them from the ellipses.posterior list

group_comm_names

# split them and conver to a matrix, NB byrow = T

split_group_comm

nrow(ellipse_df), 2, byrow = TRUE)

ellipse_df$community

ellipse_df$group

ellipse_df

現在來創建情節 . 首先根據需要繪制所有原始數據 .

first.plot

geom_point(aes(color = factor(group):factor(community)), size = 2)+

ylab(expression(paste(delta^{15}, "N (\u2030)")))+

xlab(expression(paste(delta^{13}, "C (\u2030)"))) +

theme(text = element_text(size=15))

print(first.plot)

現在我們可以嘗試按組添加頂部和刻面上的后橢圓

second.plot

print(second.plot)

# rename columns of ellipse_df to match the aesthetics

third.plot

geom_polygon(data = ellipse_df,

mapping = aes(iso1, iso2,

group = rep,

color = factor(group):factor(community),

fill = NULL),

fill = NA,

alpha = 0.2)

print(third.plot)

總結

以上是生活随笔為你收集整理的JAVA定义一个多边形类_如何在每个数据类别中绘制多个多边形?的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。