<html xmlns:v="urn:schemas-microsoft-com:vml" 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:0cm;
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";}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR-CH" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US">Dear Jeremy,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US">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 lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US">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 lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US">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 lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US">You can find more information on margin on the “par” help page.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US">Hope this helps.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US">Matthias<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="FR">De :</span></b><span lang="FR"> traminer-users-bounces@lists.r-forge.r-project.org [mailto:traminer-users-bounces@lists.r-forge.r-project.org]
<b>De la part de</b> Reynolds, Jeremy E<br>
<b>Envoyé :</b> vendredi 14 octobre 2016 23:15<br>
<b>À :</b> Users questions <traminer-users@lists.r-forge.r-project.org><br>
<b>Objet :</b> [Traminer-users] reduce space between subplots in seqdplot<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">Dear TraMineR Users,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">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></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Jeremy<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">library(TraMineR)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">library(WeightedCluster)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">data(mvad)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">mvad.alphabet <- c("employment", "FE", "HE", "joblessness", "school", "training")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">mvad.labels <- c("Employment", "Further Education", "Higher Education", "Joblessness", "School", "Training")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">mvad.scodes <- c("EM", "FE", "HE", "JL", "SC", "TR")<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">mvadseq <- seqdef(mvad[, 17:86], alphabet = mvad.alphabet, states = mvad.scodes, labels = mvad.labels, weights = mvad$weight, xtstep = 6)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#Defining the custom cost matrix<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">subm.custom <- matrix(<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> c(0, 1, 1, 2, 1, 1,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> 1, 0, 1, 2, 1, 2,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> 1, 1, 0, 3, 1, 2,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> 2, 2, 3, 0, 3, 1,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> 1, 1, 1, 3, 0, 2,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> 1, 2, 2, 1, 2, 0),<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> nrow = 6, ncol = 6, byrow = TRUE)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">mvaddist1.0 <- seqdist(mvadseq, method = "OM", indel = 1.0, sm = subm.custom)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">pamclust1.0 <- wcKMedRange(mvaddist1.0, kvals = 2:10, weights = mvad$weight)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#save plot to file<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">png(filename = "test.png", width = 1500, height = 3500, units = "px", pointsize=30)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">seqdplot(mvadseq, group = pamclust1.0$clustering$cluster4, border = NA,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> use.layout=TRUE, cols=1, axes="bottom", cex.legend=2,legend.prop=.05)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">dev.off()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-bottom:solid windowtext 1.5pt;padding:0cm 0cm 1.0pt 0cm">
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US">Dr. Jeremy Reynolds<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Professor<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">309 Stone Hall <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Department of Sociology<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">700 W. State Street<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Purdue University <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">West Lafayette, IN 47907 <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Phone: (765) 496-3348 <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><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></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>