Quantcast

Resize Graphics Window

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Resize Graphics Window

Sigal Blay
Need way to resize an existing graphics window.
This should be applicable across platforms (as part of a package).
Context: function1() draws main plot (I'm using grid), function2() adds smaller plot
above main plot, but this one can sometimes overflow the original graphics window
area.

Thanks,
Sigal

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Resize Graphics Window

Tal Galili
Hi Sigal, could you give a simple example ?

I can imagine in some cases that enlarging the windows would help, but on
others there are other parameters you would like to play with instead.  So
having an example to solve, will help people help you.

Tal


----------------Contact
Details:-------------------------------------------------------
Contact me: [hidden email] |  972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
----------------------------------------------------------------------------------------------




On Sat, May 1, 2010 at 7:40 AM, Sigal Blay <[hidden email]> wrote:

> Need way to resize an existing graphics window.
> This should be applicable across platforms (as part of a package).
> Context: function1() draws main plot (I'm using grid), function2() adds
> smaller plot
> above main plot, but this one can sometimes overflow the original graphics
> window
> area.
>
> Thanks,
> Sigal
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Resize Graphics Window

Sigal Blay
Here's a simplified code example.


library(grid)
vp1 <- viewport(height=0.8, width=0.8, default.unit="snpc")
vp2 <- viewport(y = 0.5, just="bottom", gp=gpar(col="red", lwd="2"))

# draw triangle
function1 <- function(vp) {
  grid.polygon(x=c(0,0.5,1), y=c(0.5,0,0.5), name="triangle", vp=vp)
}

# draw n horizontal lines above the triangle
function2 <- function(n, vp) {
   vp2$height <- unit(n*0.2, "npc")
   for (i in 1:n)
     grid.lines(x=c(0,1), y=c(i*0.2, i*0.2), vp=vp)
}

function1(vp1)
pushViewport(vp1)
function2(5, vp2)  # User needs to draw 5 lines above triangle
popViewport()


----- Original Message -----
From: "Tal Galili" <[hidden email]>
To: "Sigal Blay" <[hidden email]>
Cc: [hidden email]
Sent: Saturday, May 1, 2010 11:48:43 PM GMT -08:00 US/Canada Pacific
Subject: Re: [R] Resize Graphics Window



Hi Sigal, could you give a simple example ?


I can imagine in some cases that enlarging the windows would help, but on others there are other parameters you would like to play with instead. So having an example to solve, will help people help you.


Tal


----------------Contact Details:-------------------------------------------------------
Contact me: [hidden email] | 972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English)
----------------------------------------------------------------------------------------------





On Sat, May 1, 2010 at 7:40 AM, Sigal Blay < [hidden email] > wrote:


Need way to resize an existing graphics window.
This should be applicable across platforms (as part of a package).
Context: function1() draws main plot (I'm using grid), function2() adds smaller plot
above main plot, but this one can sometimes overflow the original graphics window
area.

Thanks,
Sigal

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help 
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html 
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

rtracker dependencies installation problem?

Sigal Blay
In reply to this post by Tal Galili
Why do I get this error message?

> library("rtracklayer")
> session <- browserSession()
> x<-ucscTableQuery(session, "knownGene" , GenomicRanges(0,12000,"chr1"))

Error in solveUserSEW0(start = start, end = end, width = width) :
  solving row 1: range cannot be determined from the supplied arguments (too many NAs)
In addition: Warning message:
In range(c("mammal", "hg19", "Human", "chr21:33,031,597-33,041,570" :
  NAs introduced by coercion

> traceback()

10: .Call("solve_user_SEW0", start, end, width, PACKAGE = "IRanges")
9: solveUserSEW0(start = start, end = end, width = width)
8: IRanges(start, end)
7: GenomicRanges(range[1], range[2], posSplit[1], x[["db"]])
6: range(c("mammal", "hg19", "Human", "chr21:33,031,597-33,041,570"), na.rm = FALSE)
5: range(<S4 object of class "UCSCSession">, na.rm = FALSE)
4: mergeRange(range(x), range)
3: .local(x, ...)
2: ucscTableQuery(session, "knownGene", GenomicRanges(0, 1e+05, "chr1"))
1: ucscTableQuery(session, "knownGene", GenomicRanges(0, 1e+05, "chr1"))

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: rtracker dependencies installation problem?

Martin Morgan
On 05/09/2010 07:11 PM, Sigal Blay wrote:

> Why do I get this error message?
>
>> library("rtracklayer")
>> session <- browserSession()
>> x<-ucscTableQuery(session, "knownGene" , GenomicRanges(0,12000,"chr1"))
>
> Error in solveUserSEW0(start = start, end = end, width = width) :
>   solving row 1: range cannot be determined from the supplied arguments (too many NAs)
> In addition: Warning message:
> In range(c("mammal", "hg19", "Human", "chr21:33,031,597-33,041,570" :
>   NAs introduced by coercion
>
>> traceback()
>
> 10: .Call("solve_user_SEW0", start, end, width, PACKAGE = "IRanges")
> 9: solveUserSEW0(start = start, end = end, width = width)
> 8: IRanges(start, end)
> 7: GenomicRanges(range[1], range[2], posSplit[1], x[["db"]])
> 6: range(c("mammal", "hg19", "Human", "chr21:33,031,597-33,041,570"), na.rm = FALSE)
> 5: range(<S4 object of class "UCSCSession">, na.rm = FALSE)
> 4: mergeRange(range(x), range)
> 3: .local(x, ...)
> 2: ucscTableQuery(session, "knownGene", GenomicRanges(0, 1e+05, "chr1"))
> 1: ucscTableQuery(session, "knownGene", GenomicRanges(0, 1e+05, "chr1"))

Hi Sigal --

ask questions about Bioconductor packages on the Bioconductor mailing list

  http://bioconductor.org/docs/mailList.html

Provide the output of sessionInfo(), and ensure that your packages are
up-to-date, e.g., following instructions at the bottom of

  http://bioconductor.org/docs/install/

Your traceback() looks suspicious -- why 1e+05, and not 12000 ? Have you
copy / pasted correctly?

Post a new message when starting a new topic, rather than replying to an
unrelated article with a new title.

And FWIW

> library(rtracklayer)
Loading required package: RCurl
Loading required package: bitops
> session=browserSession()
> x = ucscTableQuery(session, "knownGene", GenomicRanges(0, 12000, "chr1"))
> sessionInfo()
R version 2.11.0 Patched (2010-05-01 r51886)
x86_64-unknown-linux-gnu

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] rtracklayer_1.8.1 RCurl_1.4-1       bitops_1.0-4.1

loaded via a namespace (and not attached):
[1] Biobase_2.8.0       Biostrings_2.16.0   BSgenome_1.16.1
[4] GenomicRanges_1.0.1 IRanges_1.6.0       XML_2.8-1

Martin

>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


--
Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Loading...