problem in gl.pcoa: getting "figure margins too large"

76 views
Skip to first unread message

jbo...@gmail.com

unread,
Sep 27, 2020, 2:21:29 AM9/27/20
to dartR
Any suggestions on how to deal with this error message: "Error in plot.new() : figure margins too large" ?  I searched on-line and tried the various suggestions but nothing worked.  Here are the specifics (I started with a genind data):

> gl.data <- gi2gl(gi.informative01_noNA)
Starting gi2gl
Loading required package: parallel
Completed: gi2gl
> gl.data
 /// GENLIGHT OBJECT /////////


 // 64 genotypes,  2,986 binary SNPs, size: 402.4 Kb
 0 (0 %) missing data

 // Basic content
   @gen: list of 64 SNPbin
   @ploidy: ploidy of each individual  (range: 2-2)

 // Optional content
   @ind.names:  64 individual labels
   @loc.names:  2986 locus labels
   @other: a list containing: loc.metrics.flags

> pcoa <- gl.pcoa(gl.data)
Starting gl.pcoa
  Processing a SNP dataset
  Performing a PCA, individuals as entities, loci as attributes, SNP genotype as state
Error in plot.new() : figure margins too large

Thanks for any help. I got the same error when I used the equivalent with the genind object.  What I need is a scree plot and amount of variance explained by the first few eigenvalues. I don't seem to get past whatever wants to be plotted.

Janice Boyd
Texas A&M University

Berry, Olly (NCMI, IOMRC Crawley)

unread,
Sep 27, 2020, 3:47:54 AM9/27/20
to da...@googlegroups.com
Hi Janice,

Somebody had a similar error for plotting results of a different function, and Bernd’s solution worked. It’s likely to do with settings in Rstudio. I’ve pasted the correspondence below.
Hope it works.
Cheers,
Olly

Hi folks,

I'm fairly new to using the dartR package, but I'm having trouble obtaining a report on heterozygosity for the populations in my data.

I've tried running the gl.report.heterozygosity() function.
I'm using the latest version of RStudio, R v4.0.0, and have updated all packages. I was initially using the current CRAN version of dartR. The gl.report.heterozygosity() function would just hang and produce no output. Then I switched to the current development version of dartR - the function thenworked for a brief time, but now, for some reason which I cannot fathom it no longer works, but instead of hanging it gives the following error:

> x1 <- gl.report.heterozygosity(testset.gl, + method="pop",boxplot="standard", verbose = 5)

Starting gl.report.heterozygosity [ Build = Jacob ]
   Processing a SNP dataset
   Warning: genlight object contains monomorphic loci which will be factored into heterozygosity estimates
   Calculating Observed Heterozygosities, averaged across loci, for each population
   Calculating Expected Heterozygosities
Error in plot.new() : figure margins too large

I've tried changing plot margins [e.g. par(mar = c(0.1, 0.1, 0.1, 0.1))], but this has no effect. I also found some previous discussion on this forum about this function but this hasn't helped - I'm not sure I can install a previous version of adegenet as this apparently requires a previous version of Rtools.

Cheers,
Peter
Bernd. Gruber 
24 Jun

Hi,

 

This could be an rstudio problem (the plot area is too small in your setting. Either enlarge the plot window of click on zoom to create an independent plotting window. If this does not work please let me know. The current way of plotting is not ideal (one big thing to work on is to convert to ggplot type plots as they are much easier to handle.

 

Cheers, Bernd

- show quoted text -

-- 
You received this message because you are subscribed to the Google Groups "dartR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to da...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dartr/9a068f0e-3b88-40f8-b3fa-025bb96b24f2n%40googlegroups.com.

Peter Kriesner 
24 Jun
Thanks very much Bernd for responding so quickly. Yes, that indeed worked!

Cheers,
Peter


—-
CSIRO Environomics Future Science Platform


From: da...@googlegroups.com <da...@googlegroups.com> on behalf of jbo...@gmail.com <jbo...@gmail.com>
Sent: Sunday, September 27, 2020 2:21:29 PM
To: dartR <da...@googlegroups.com>
Subject: [dartR] problem in gl.pcoa: getting "figure margins too large"
 
--
You received this message because you are subscribed to the Google Groups "dartR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dartr+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dartr/14d556b6-6da1-4418-99f2-13d530297521n%40googlegroups.com.

Bernd.Gruber

unread,
Sep 27, 2020, 4:15:36 AM9/27/20
to da...@googlegroups.com
try to make the plot area larger in Rstudio or press zoom before you run the command.

On 27 Sep 2020, at 16:21, jbo...@gmail.com <jbo...@gmail.com> wrote:


--

Janice Boyd

unread,
Sep 27, 2020, 12:52:39 PM9/27/20
to da...@googlegroups.com
How do I enlarge the plot window?
Janice

Arthur Georges

unread,
Sep 27, 2020, 6:14:51 PM9/27/20
to da...@googlegroups.com
Mouse on the boundary, pull left. :)

A



--
---------------------------------------------------------------------------------------------------------------------------
D-Prof. Arthur Georges
Institute for Applied Ecology, University of Canberra ACT 2601 Australia
Deliveries: Bld 3 Stores, Kirinari Street, Bruce ACT 2617
Tel : +61 (0)2 6201 5786  Fax: +61 (0)2 6201 5305  Mobile: +61 (0)418 866741
WWW: http://georges.biomatix.org
   ORCID ID: http://orcid.org/0000-0003-2428-0361
Reply all
Reply to author
Forward
0 new messages