Skip to main content
code for example added to the question
Source Link
Gilbert
  • 3.6k
  • 18
  • 29

Several arguments of the seqplot family functions of TraMineR such as cex.legend, legend.prop can be used to control the legend. In addition, most arguments of legend such as ncol can be passed among the ... argument list.

I illustrate with the actcal data:

data(actcal)
## We use only a sample of 300 cases
set.seed(1)
actcal <- actcal[sample(nrow(actcal),300),]
actcal.lab <- c("> 37 hours", "19-36 hours", "1-18 hours", "no work")
actcal.seq <- seqdef(actcal,13:24,labels=actcal.lab)

seqdplot(actcal.seq, group=actcal$sex, ncol=4, legend.prop=.1, cex.legend=1.2)

enter image description here


Edit

For the example you have added in your question, you should increase the proportion of the plot (legend.prop) left for the legend. For example, the following seems to work fine:

seqIplot(cci.new, 
         with.legend = TRUE,
         bty = "n",
         idxs = 1:300,
         group = dat$age50,
         legend.prop = 0.2,
         cex.legend=1.2,
         ncol=4,
         main = "300 individual sequences by disability status")

enter image description here

Several arguments of the seqplot family functions of TraMineR such as cex.legend, legend.prop can be used to control the legend. In addition, most arguments of legend such as ncol can be passed among the ... argument list.

I illustrate with the actcal data:

data(actcal)
## We use only a sample of 300 cases
set.seed(1)
actcal <- actcal[sample(nrow(actcal),300),]
actcal.lab <- c("> 37 hours", "19-36 hours", "1-18 hours", "no work")
actcal.seq <- seqdef(actcal,13:24,labels=actcal.lab)

seqdplot(actcal.seq, group=actcal$sex, ncol=4, legend.prop=.1, cex.legend=1.2)

enter image description here

Several arguments of the seqplot family functions of TraMineR such as cex.legend, legend.prop can be used to control the legend. In addition, most arguments of legend such as ncol can be passed among the ... argument list.

I illustrate with the actcal data:

data(actcal)
## We use only a sample of 300 cases
set.seed(1)
actcal <- actcal[sample(nrow(actcal),300),]
actcal.lab <- c("> 37 hours", "19-36 hours", "1-18 hours", "no work")
actcal.seq <- seqdef(actcal,13:24,labels=actcal.lab)

seqdplot(actcal.seq, group=actcal$sex, ncol=4, legend.prop=.1, cex.legend=1.2)

enter image description here


Edit

For the example you have added in your question, you should increase the proportion of the plot (legend.prop) left for the legend. For example, the following seems to work fine:

seqIplot(cci.new, 
         with.legend = TRUE,
         bty = "n",
         idxs = 1:300,
         group = dat$age50,
         legend.prop = 0.2,
         cex.legend=1.2,
         ncol=4,
         main = "300 individual sequences by disability status")

enter image description here

Source Link
Gilbert
  • 3.6k
  • 18
  • 29

Several arguments of the seqplot family functions of TraMineR such as cex.legend, legend.prop can be used to control the legend. In addition, most arguments of legend such as ncol can be passed among the ... argument list.

I illustrate with the actcal data:

data(actcal)
## We use only a sample of 300 cases
set.seed(1)
actcal <- actcal[sample(nrow(actcal),300),]
actcal.lab <- c("> 37 hours", "19-36 hours", "1-18 hours", "no work")
actcal.seq <- seqdef(actcal,13:24,labels=actcal.lab)

seqdplot(actcal.seq, group=actcal$sex, ncol=4, legend.prop=.1, cex.legend=1.2)

enter image description here