[Traminer-users] seqrplot: Error in plot.new() : figure margins too large

Matthias Studer Matthias.Studer at unige.ch
Thu Mar 10 10:19:35 CET 2011


Dear Jane,

The problems is that the margins of your plot are too large and that 
there is not enough space to plot it (and to plot what is inside the 
margins). This error appears sometimes on windows if your plot window is 
too small. You may try to maximize it before plotting. Another solution 
would be to plot into a pdf with an appropriate size (maybe try several 
values of width and height)

pdf(file="myplot.pdf", width=20, height=20)
seqmtplot(Org.seq, group=co.fac)
dev.off()

Finally, another solution would be to reduce the margins using the "par" 
command (see the help of "par" for more details) for instance:

par(mar = c(1,1,1,1))
seqmtplot(Org.seq, group=co.fac)

Let us know if it fixed your problem.
All the best,

Matthias Studer

Le 09.03.2011 16:27, Alexis Gabadinho a écrit :
> Dear Jane,
>
> I tried to reproduce the problem by creating an artificial sequence 
> data set and a clustering variable with the same characteristics as yours:
>
> library(TraMineR)
>
> co.fac <- rep(paste("Gr",1:8, sep=""), 500)
> ex <- seqgen(4000, 120, 1:10)
> Org.seq <- seqdef(ex)
>
> ## mean time plot
> seqmtplot(Org.seq, group=co.fac)
>
> The code above works perfectly both on Linux (R 2.10) and Windows (R 
> 2.12). You can try it on your computer. If you get an error with this 
> code, could you tell me which R and TraMineR versions you use ?
>
> Moreover I see an error in your "seqrplot" code :
>
> seqrplot(Org.seq, group = co.fac, co.fac, border=NA)
>
> You have to provide a distance matrix (created with "seqdist()") for 
> plotting representative sequences, and instead you pass "co.fac" 
> again. Your code should look like this (replace "my.dist.matrix" by 
> the name of your distance matrix):
>
> seqrplot(Org.seq, group = co.fac, dist.matrix= my.dist.matrix , border=NA)
>
> Sometimes, if a graphic window is open and an error occurs with the 
> plotting function, you have to close the graphic window before running 
> the corrected code again.
>
> Let me know if this is the solution to your problem.
>
> Best,
> Alexis.
>
>
>
> Le 08. 03. 11 21:08, Jane K. Ohgami a écrit :
>>
>> I am new to TraMineR and have what is probably a very basic question 
>> regarding plot/graphing commands for cluster analysis.
>> I am analyzing career transitions and my data set consists of
>>
>>  [>] 3842 sequences with 10 distinct events/states
>>  [>] 2590 distinct sequences
>>  [>] min/max sequence length: 120/120
>>
>> Trying to exercise the following syntax:
>> seqmtplot(Org.seq, group = co.fac, border=NA) or
>> seqrplot(Org.seq, group = co.fac, co.fac, border=NA)
>>
>> I get the following error message:
>> >Error in plot.new() : figure margins too large
>>
>> I have unsuccessfully tried to adjust for this so would appreciate 
>> any suggestions. Basically I need to figure out how my 8 clusters 
>> break down. Any suggestions/advice would be greatly appreciated. 
>> Thank you!
>>
>>
>> _______________________________________________
>> 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
>
>
> _______________________________________________
> 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/20110310/209c988a/attachment.htm>


More information about the Traminer-users mailing list