[Traminer-users] modify legend in plot from WeightedCluster package

Gilbert Ritschard Gilbert.Ritschard at unige.ch
Fri Feb 1 09:01:05 CET 2013


Hi Jeremy,

The legend position is controlled with the legendpos argument:

plot(pam1, legendpos="topleft")

For  more control on the legend such as on the number of columns you can make the plot with the "withlegend=FALSE" argument and then use the R legend function (type ?legend for details). Here is an example:

plot(pam1, stat = c("PBC", "HG", "ASW"),  legendpos="top",  withlegend=F)
legend("top",  c("PBC", "HG", "ASW"), fill = c("black", "red", "green"), ncol = 2)

Gilbert

From: traminer-users-bounces at lists.r-forge.r-project.org [mailto:traminer-users-bounces at lists.r-forge.r-project.org] On Behalf Of Jeremy Reynolds
Sent: Thursday, January 31, 2013 17:25
To: traminer-users at lists.r-forge.r-project.org
Subject: [Traminer-users] modify legend in plot from WeightedCluster package

Dear TraMineR Users,

I am using the WeightedCluster library and have produced a graph of the stopping rule statistics that it provides through the wcKMedRange command.  The code below produces a very useful plot, but the legend hides a portion of the graph.  Does anyone know how I can move the existing legend to the top left corner and perhaps make it two columns instead of one?

Thanks,

Jeremy

pam1 <- wcKMedRange(diss4vs, kvals = 2:10, weights = aggbhps$aggWeights)
plot(pam1)

--
********************
Dr. Jeremy Reynolds
Associate Professor
Undergraduate Coordinator
Department of Sociology
117 Baldwin Hall
University of Georgia
Athens, GA 30602-1611
Phone: (706) 583-8072<tel:%28706%29%20583-8072>
Web: http://uga.edu/soc/people/faculty/reynolds_jeremy.php
Fax: (706) 542-4320<tel:%28706%29%20542-4320>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/traminer-users/attachments/20130201/fef4e7a2/attachment.html>


More information about the Traminer-users mailing list