Description Usage Arguments Examples
Function to select bonds based on colors and parameters
1 | selectBonds(Bds, Cols, Betas)
|
Bds |
matrix of neighbouring bonds. |
Cols |
vector of colors per vertex. |
Betas |
vector of parameters for the Potts model. |
1 2 3 4 5 6 7 8 9 10 11 | Obs.loc = expand.grid(1:10,1:10)
Bds = getBonds(Obs.loc)
Bds = Bds[which(Bds[,1]>0),]
Betas = c(0.8, 0.8, 0.2)
Cols = sample(1:3, 100, replace = TRUE)
Bd = selectBonds(Bds, Cols, Betas)
par(mfrow = c(1,1))
col = grey.colors(3)
image(matrix(Cols, ncol = 10), col = col)
segments((Obs.loc[Bd[,1],1]-1)/9, (Obs.loc[Bd[,1],2]-1)/9, (Obs.loc[Bd[,2],1]-1)/9, (Obs.loc[Bd[,2],2]-1)/9)
segments((Obs.loc[,1]-1)/9, (Obs.loc[,2]-1)/9, (Obs.loc[,1]-1)/9, (Obs.loc[,2]-1)/9, lwd = 4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.