<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle21
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle22
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Thank you so much! Can you also tell me how to change the titles of the subplots and the titles of the Y axes? The Y-axes could all be the same (e.g., “Proportion” instead of the default “Freq.(weighted n =
)“, but I would probably want a unique title for each subgraph to replace the medoid ID numbers.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Jeremy<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> traminer-users-bounces@lists.r-forge.r-project.org [mailto:traminer-users-bounces@lists.r-forge.r-project.org]
<b>On Behalf Of </b>Matthias Studer<br>
<b>Sent:</b> Monday, October 17, 2016 4:00 AM<br>
<b>To:</b> Users questions <traminer-users@lists.r-forge.r-project.org><br>
<b>Subject:</b> Re: [Traminer-users] reduce space between subplots in seqdplot<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="color:#1F497D">Dear Jeremy,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">You can do it by re-specifying the margins of your plot with the par(mar=c(…)) command.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">According to the par help page, the mar argument sets the margins using a “numerical vector of the form c(bottom, left, top, right) which gives the number of lines of margins to be specified on the four sides
of the plot. The default is c(5, 4, 4, 2) + 0.1”<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">You typically want to reduce the top and bottom margins. You will probably need several tries to get the right settings.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">You can find more information on margin on the “par” help page.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Hope this helps.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Matthias<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span lang="FR">De :</span></b><span lang="FR"> <a href="mailto:traminer-users-bounces@lists.r-forge.r-project.org">
traminer-users-bounces@lists.r-forge.r-project.org</a> [<a href="mailto:traminer-users-bounces@lists.r-forge.r-project.org">mailto:traminer-users-bounces@lists.r-forge.r-project.org</a>]
<b>De la part de</b> Reynolds, Jeremy E<br>
<b>Envoyé :</b> vendredi 14 octobre 2016 23:15<br>
<b>À :</b> Users questions <<a href="mailto:traminer-users@lists.r-forge.r-project.org">traminer-users@lists.r-forge.r-project.org</a>><br>
<b>Objet :</b> [Traminer-users] reduce space between subplots in seqdplot<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="FR-CH"><o:p> </o:p></span></p>
<p class="MsoNormal">Dear TraMineR Users,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Jeremy<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">library(TraMineR)<o:p></o:p></p>
<p class="MsoNormal">library(WeightedCluster)<o:p></o:p></p>
<p class="MsoNormal">data(mvad)<o:p></o:p></p>
<p class="MsoNormal">mvad.alphabet <- c("employment", "FE", "HE", "joblessness", "school", "training")<o:p></o:p></p>
<p class="MsoNormal">mvad.labels <- c("Employment", "Further Education", "Higher Education", "Joblessness", "School", "Training")<o:p></o:p></p>
<p class="MsoNormal">mvad.scodes <- c("EM", "FE", "HE", "JL", "SC", "TR")<o:p></o:p></p>
<p class="MsoNormal">mvadseq <- seqdef(mvad[, 17:86], alphabet = mvad.alphabet, states = mvad.scodes, labels = mvad.labels, weights = mvad$weight, xtstep = 6)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">#Defining the custom cost matrix<o:p></o:p></p>
<p class="MsoNormal">subm.custom <- matrix(<o:p></o:p></p>
<p class="MsoNormal"> c(0, 1, 1, 2, 1, 1,<o:p></o:p></p>
<p class="MsoNormal"> 1, 0, 1, 2, 1, 2,<o:p></o:p></p>
<p class="MsoNormal"> 1, 1, 0, 3, 1, 2,<o:p></o:p></p>
<p class="MsoNormal"> 2, 2, 3, 0, 3, 1,<o:p></o:p></p>
<p class="MsoNormal"> 1, 1, 1, 3, 0, 2,<o:p></o:p></p>
<p class="MsoNormal"> 1, 2, 2, 1, 2, 0),<o:p></o:p></p>
<p class="MsoNormal"> nrow = 6, ncol = 6, byrow = TRUE)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">mvaddist1.0 <- seqdist(mvadseq, method = "OM", indel = 1.0, sm = subm.custom)<o:p></o:p></p>
<p class="MsoNormal">pamclust1.0 <- wcKMedRange(mvaddist1.0, kvals = 2:10, weights = mvad$weight)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">#save plot to file<o:p></o:p></p>
<p class="MsoNormal">png(filename = "test.png", width = 1500, height = 3500, units = "px", pointsize=30)<o:p></o:p></p>
<p class="MsoNormal">seqdplot(mvadseq, group = pamclust1.0$clustering$cluster4, border = NA,<o:p></o:p></p>
<p class="MsoNormal"> use.layout=TRUE, cols=1, axes="bottom", cex.legend=2,legend.prop=.05)<o:p></o:p></p>
<p class="MsoNormal">dev.off()<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-bottom:solid windowtext 1.5pt;padding:0in 0in 1.0pt 0in">
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">Dr. Jeremy Reynolds<o:p></o:p></p>
<p class="MsoNormal">Professor<o:p></o:p></p>
<p class="MsoNormal">309 Stone Hall <o:p></o:p></p>
<p class="MsoNormal">Department of Sociology<o:p></o:p></p>
<p class="MsoNormal">700 W. State Street<o:p></o:p></p>
<p class="MsoNormal">Purdue University <o:p></o:p></p>
<p class="MsoNormal">West Lafayette, IN 47907 <o:p></o:p></p>
<p class="MsoNormal">Phone: (765) 496-3348 <o:p></o:p></p>
<p class="MsoNormal"><a href="https://www.cla.purdue.edu/sociology/directory/index.aspx?p=Jeremy_Reynolds">https://www.cla.purdue.edu/sociology/directory/index.aspx?p=Jeremy_Reynolds</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>