[Traminer-users] Question about legends

Alexis Gabadinho Alexis.Gabadinho at unige.ch
Tue Sep 11 15:00:34 CEST 2012


Hi Vasco,

I just discovered that there exists a possible solution, at least if you 
don't have too many states. You can use the "density" and "angle" 
standard R options, as in the example below. The "density" argument is 
for the density of the lines, you can use either a single value or a 
vector with at most one value for each state (in the example I use only 
three different densities,which are repeated), and "angle" is for the 
angle of the lines, and you can also use either a single value or a 
vector as in the example.

You will have to plot the legend separately, by using "withlegend=FALSE" 
for seqdplot and then seqlegend with the same "density" and "angle" 
arguments

library(TraMineR)

## creating the sequence object
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")
mvad.seq <- seqdef(mvad, 17:86, alphabet = mvad.alphabet, states = mvad.scodes, labels = mvad.labels, xtstep = 6)

## Plotting
seqdplot(mvad.seq, density=c(20,30,40), angle=c(30,60,90,120,150,180), withlegend=F)
seqlegend(mvad.seq, density=c(20,30,40), angle=c(30,60,90,120,150,180))
  

Best regards,
Alexis


Le 11. 09. 12 14:47, Vasco Miguel dos Santos Ramos a écrit :
>
> Hi All, my first question here.
>
> I have been using TraMineR for about 2 years now and it works fine.
>
> Right now I have a publisher that wants us to use black and white 
> graphs for a seqdplot.
>
> Up to now I used only the colors in the palette (with mypal, etc..)
>
> I have tried different combinations of black, white and shades of 
> grey. But it's not perfect.
>
> Another solution would be to use dots against white, line against 
> white, symbols, etc.
>
> But I simply don't know how to do it. I am not an expert user of R, i 
> have used almost only TraMineR.
>
> Is it possible to do a seqdplot in the way that I described?
>
> Regards
>
> Vasco
>
>
>
> _______________________________________________
> Traminer-users mailing list
> Traminer-users at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users

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


More information about the Traminer-users mailing list