I am trying to configure the y-axis of a sequence index plot using the R-package TraMineR
, I figured out how to set a global limit for the y-axis which is helpful if you want compare the number of certain sequences between two or more groups as it equalizes the scale. But I did not manage to set the y-axis ticks (as in xtstep). Maybe you can quickly help me out using this example code:
library(TraMineR)
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")
## Define sequence objects
mvad.seq <- seqdef(mvad[, 17:86], alphabet = mvad.alphabet,
states = mvad.scodes, labels = mvad.labels, weights = mvad$weight, xtstep = 6)
## Plots
seqIplot(mvad.seq, group=mvad$gcse5eq, withlegend=TRUE, border=NA, xtstep=3, sortv="from.start") ## Default plot
seqIplot(mvad.seq, group=mvad$gcse5eq, withlegend=TRUE, border=NA, xtstep=3, sortv="from.start", ylim=c(0, 400)) ## Plot with custom ylim to compare the number of sequences between groups
The default sequence index plot looks like this and makes it very difficult to compare the two groups:
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…