[Traminer-users] reduce space between subplots in seqdplot

Reynolds, Jeremy E reyno113 at purdue.edu
Fri Oct 14 23:14:43 CEST 2016


Dear TraMineR Users,

I would like to reduce the amount of space between the subplots created with seqdplot and the group option.  Does anyone know how to do this?  I have provided an example below that makes the plot and then save it as a .png file.  The code works, but I would like the space between the title of each graph and the adjacent graph to be smaller.

Thanks,

Jeremy



library(TraMineR)
library(WeightedCluster)
data(mvad)
mvad.alphabet <- c("employment", "FE", "HE", "joblessness", "school", "training")
mvad.labels <- c("Employment", "Further Education", "Higher Education", "Joblessness", "School", "Training")
mvad.scodes <- c("EM", "FE", "HE", "JL", "SC", "TR")
mvadseq <- seqdef(mvad[, 17:86], alphabet = mvad.alphabet, states = mvad.scodes, labels = mvad.labels, weights = mvad$weight, xtstep = 6)

#Defining the custom cost matrix
subm.custom <- matrix(
  c(0, 1, 1, 2, 1, 1,
    1, 0, 1, 2, 1, 2,
    1, 1, 0, 3, 1, 2,
    2, 2, 3, 0, 3, 1,
    1, 1, 1, 3, 0, 2,
    1, 2, 2, 1, 2, 0),
  nrow = 6, ncol = 6, byrow = TRUE)

mvaddist1.0 <- seqdist(mvadseq, method = "OM", indel = 1.0, sm = subm.custom)
pamclust1.0 <- wcKMedRange(mvaddist1.0, kvals = 2:10, weights = mvad$weight)

#save plot to file
png(filename = "test.png", width = 1500, height = 3500, units = "px", pointsize=30)
seqdplot(mvadseq, group = pamclust1.0$clustering$cluster4, border = NA,
         use.layout=TRUE, cols=1, axes="bottom", cex.legend=2,legend.prop=.05)
dev.off()


Dr. Jeremy Reynolds
Professor
309 Stone Hall
Department of Sociology
700 W. State Street
Purdue University
West Lafayette, IN 47907
Phone: (765) 496-3348
https://www.cla.purdue.edu/sociology/directory/index.aspx?p=Jeremy_Reynolds

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20161014/985f8eb2/attachment.html>


More information about the Traminer-users mailing list