The main function plot.mat
plots a (optionally partitioned) matrix. If the matrix is partitioned, the rows and columns of the matrix are rearranged according to the partitions. Other functions are only wrappers for plot.mat
for convenience when plotting the results of the corresponding functions. The plot.mat.nm
plots two matrices based on M, normalized by rows and columns, next to each other.
plot.mat(x=M, M=x, clu = NULL, ylab = "", xlab = "", main = NULL,
print.val = !length(table(M)) <= 2,="" print.0="FALSE," plot.legend="!print.val" &&="" !length(table(m))="" <="2," print.legend.val="out" ,="" print.digits.legend="2," print.digits.cells="2," print.cells.mf="NULL," outer.title="!plot.legend," title.line="ifelse(outer.title," -1.5,="" 7),="" mar="c(0.5," 7,="" 8.5,="" 0)="" +="" 0.1,="" cex.val="default" val.y.coor.cor="0," val.x.coor.cor="0," cex.legend="1," legend.title="Legend" cex.axes="default" print.axes.val="NULL," print.x.axis.val="!is.null(colnames(M))," print.y.axis.val="!is.null(rownames(M))," x.axis.val.pos="1.1," y.axis.val.pos="-0.1," cex.main="par()$cex.main," cex.lab="par()$cex.lab," yaxis.line="-1.5," xaxis.line="-1," legend.left="0.4," legend.up="0.03," legend.size="1/min(dim(M))," legend.text.hor.pos="0.5," par.line.width="3," par.line.col="blue" im.dens="NULL," im="NULL," wnet="1," wim="NULL," use.im="length(dim(IM))==length(dim(M))|!is.null(wIM)," dens.leg="c(null" =="" 100),="" blackdens="70," plotlines="TRUE," ...)="" plot.mat.nm(x="M," m="x," ...,="" main.title="NULL," title.row="Row normalized" title.col="Column normalized" main.title.line="-2," par.set="list(mfrow" c(1,="" 2)))<="" p=""># S3 method for mat
plot(x=M, M=x, clu = NULL, ylab = "", xlab = "",
main = NULL, print.val = !length(table(M)) <= 2,="" print.0="FALSE," plot.legend="!print.val" &&="" !length(table(m))="" <="2," print.legend.val="out" ,="" print.digits.legend="2," print.digits.cells="2," print.cells.mf="NULL," outer.title="!plot.legend," title.line="ifelse(outer.title," -1.5,="" 7),="" mar="c(0.5," 7,="" 8.5,="" 0)="" +="" 0.1,="" cex.val="default" val.y.coor.cor="0," val.x.coor.cor="0," cex.legend="1," legend.title="Legend" cex.axes="default" print.axes.val="NULL," print.x.axis.val="!is.null(colnames(M))," print.y.axis.val="!is.null(rownames(M))," x.axis.val.pos="1.1," y.axis.val.pos="-0.1," cex.main="par()$cex.main," cex.lab="par()$cex.lab," yaxis.line="-1.5," xaxis.line="-1," legend.left="0.4," legend.up="0.03," legend.size="1/min(dim(M))," legend.text.hor.pos="0.5," par.line.width="3," par.line.col="blue" im.dens="NULL," im="NULL," wnet="1," wim="NULL," use.im="length(dim(IM))" =="length(dim(M))" |="" !is.null(wim),="" dens.leg="c(null" 100),="" blackdens="70," plotlines="TRUE," ...)<="" p="">
# S3 method for crit.fun
plot(x, main = NULL, ...)
# S3 method for opt.par
plot(x, main = NULL, which = 1, ...)
# S3 method for opt.par.mode
plot(x, main = NULL, which = 1, ...)
# S3 method for opt.more.par
plot(x, main = NULL, which = 1, ...)
# S3 method for opt.more.par.mode
plot(x, main = NULL, which = 1, ...)
# S3 method for check.these.par
plot(x, main = NULL, which = 1, ...)
=>=>
A result from a corespodning function or a matrix or similar object representing a network
A matrix or similar object representing a network - either x or M must be supplied - both are here to make the code compatible with generic and with older functions
A partition
Label for y axis
Label for x axis
Main title
Main title in nm version
The line in which main title is printed in nm version
Title for the row-normalized matrix in nm version
Title for the column-normalized matrix in nm version
A list of possible ploting paramters (to par
) to be used in nm version
Should the values be printed in the matrix
If print.val=TRUE
Should the 0s be printed in the matrix
Should the legend for shades be ploted
Should the values be printed in the legend
The number of digits that should appear in the legend
The number of digits that should appear in the cells (of the matrix and/or legend)
if not NULL
, the above argument is igonred, the cell values are printed as the cell are multiplied by this factor and rounded
Should the title be printed on the 'inner' or 'outer' plot, default is 'inner' if legend is ploted and 'outer' otherwise. May be soon omited.
The line (from the top) where the title should be printed. The suitable values depend heavily on the displey type.
A numerical vector of the form 'c(bottom, left, top, right)' which gives the lines of margin to be specified on the four sides of the plot. The R default for ordianry plots is 'c(5, 4, 4, 2) + 0.1', while this functions default is c(0.5, 7, 8.5, 0) + 0.1.
Size of the values printed. The "default" is 10/"number of units"
Correction for centering the values in the sqares in y direction
Correction for centering the values in the sqares in x direction
Size of the text in the legend
The title of the legend
Size of the characters in axes, 'default' makes the cex so small that all categories can be printed
Should the axes values be printed, 'default' prints each axis if 'rownames' or 'colnames' is not 'NULL'
Should the x axis values be printed, 'default' prints each axis if 'rownames' or 'colnames' is not 'NULL'
Should the y axis values be printed, 'default' prints each axis if 'rownames' or 'colnames' is not 'NULL'
x coordiante of the y axis values
y coordiante of the x axis values
Size of the text in the main title
Size of the text in matrix
The position of the y axis (the argument 'line')
The position of the x axis (the argument 'line')
How much left should the legend be from the matrix
How much up should the legend be from the matrix
Relative legend size
Horizontal position of the legend text (bottom) - 0 = bottom, 0.5 = middle,...
The width of the line that seperates the partitions
The color of the line that seperates the partitions
The densitiey of shading lines for each block
The image (as obtaind with crit.fun
) of the blockmodel. dens.leg
is used to translate this image into IM.dens
.
It is used to translate the IM
into IM.dens
.
At which density should the values on dark colurs of lines be printed in white.
Should the lines in the matrix be printed - default TRUE, best set to FALSE for larger networks.
Which (if there are more than one) of optimal solutions to plot
Specifies which net (if more) should be ploted - used if M is an array.
Specifies which IM (if more) should be used for ploting (defualt = wnet) - used if IM is an array.
Specifies if IM should IM be used for ploting? be used for ploting?
Aditional arguments to plot.default
for plot.mat
and also to plot.mat
for other functions
The functions are used for their side affect - plotting.
<U+017D>IBERNA, Ale<U+0161> (2006): Generalized Blockmodeling of Valued Networks. Social Networks, Jan. 2007, vol. 29, no. 1, 105-126. http://dx.doi.org/10.1016/j.socnet.2006.04.002.
<U+017D>IBERNA, Ale<U+0161>. Direct and indirect approaches to blockmodeling of valued networks in terms of regular equivalence. J. math. sociol., 2008, vol. 32, no. 1, 57-84. http://www.informaworld.com/smpp/content?content=10.1080/00222500701790207.
crit.fun
, opt.par
, opt.random.par
, opt.these.par
, check.these.par
# NOT RUN {
#Generation of the network
n<-20
net<-matrix(NA,ncol=n,nrow=n)
clu<-rep(1:2,times=c(5,15))
tclu<-table(clu)
net[clu==1,clu==1]<-rnorm(n=tclu[1]*tclu[1],mean=0,sd=1)
net[clu==1,clu==2]<-rnorm(n=tclu[1]*tclu[2],mean=4,sd=1)
net[clu==2,clu==1]<-rnorm(n=tclu[2]*tclu[1],mean=0,sd=1)
net[clu==2,clu==2]<-rnorm(n=tclu[2]*tclu[2],mean=0,sd=1)
#Ploting the network
plot.mat(M=net, clu=clu)
class(net)<-"mat"
plot(net, clu=clu)
#See corespodning functions for examples for other plotting
#functions
#presented, that are esentially only the wrappers for "plot.max"
# }
Run the code above in your browser using DataLab