Closed Derek-Jones closed 4 years ago
Hi,
there are several visualizations in seriation. Please post some code so I can have a look at it.
Regards, -MFH
Hi,
You are welcome to a copy of the data and the rest of the code. But the following is the core of the usage (the plot will appear in a book):
gfx_mat=matrix(data=0, nrow=length(f_node), ncol=length(f_node))
# gfx_mat[cbind(gfx$from, gfx$to)]=1/gfx$refs
gfx_mat[cbind(gfx$from, gfx$to)]=1+log(gfx$refs)
# gfx_mat[cbind(gfx$from, gfx$to)]=1
# gser=seriate(gfx_mat)
# gser=seriate(gfx_mat, method="BBURCG")
# Some trial and error finds "binary" gives the best clustering :-O
t=dissplot(dist(gfx_mat, method="binary"), # key=FALSE, col=rev(pal_col),
method=list(inter="TSP", aggregation="Hausdorff"),
plot=FALSE)
# Requested support for xlab and ylab
plot(t, options=list(key=FALSE, col=rev(pal_col)),
xlab="From file", ylab="To file")
dissplot
does not have xlab
and ylab
because it is made for showing clustered distance matrices where x and y contain the same sets of objects. What these objects are, goes typically into the main title.
You do not seem to use cluster labels. I think what you want is to use pimage
and use a seriation as the argument order
.
I originally used seriate
+image
, but was getting poor results.
dissplot
was tried in an attempt to improve the results, and I stuck with it when the image looked right. Copying the 'successful' options to seriate
, produces the desired results :-)
Thanks for your patience.
Not sure if you are aware, but using the the col=
option in seriate
has no effect on the output produced by image
, i.e., col=...
has to appear in the call to image
.
I have been using pimage+mtext.
It is not possible to change the size of the text given in xlab/ylab arguments (at least according to my reading of the source code).
Using pimage means there is space in the margin for mtext to put some text.
pimage
uses grid (see ? grid
). I don't think it mixes well with base R plotting functions like mtext
. Have a look at https://stackoverflow.com/questions/41858987/using-mtext-with-lattice-plots-and-grid-arrange
Also, you can set cex
using the gp
argument in pimage
.
Thanks for the link.
While mtext
works for me, the example is part of a book and the gp
argument approach looks like the approved approach (the call to gpar
requires a to call library(grid)
)
Thanks once again for your suggestions.
seriation is a great package, but not being able to add labels (in the sense of
xlab="From file", ylab="To file"
is very frustrating).Please add support for the functionality provided by
xlab
andylab
, in other plotting functions.