[R] why the length and width of a plot region produced by the dev.new() function cannot be correctly set?

MacQueen, Don m@cqueen1 @end|ng |rom ||n|@gov
Fri May 4 21:45:36 CEST 2018


But:

> dev.new(height=10,width=10)
> dev.size('in')
[1] 10 10

Whereas

> dev.new(length=10,width=10)
> dev.size('in')
[1] 10  7

Obviously, because height was not specified, some default calculation was used to set the height. And length was ignored.

And thanks to Duncan Murdoch for pointing out that the correct arguments are height and width, not length and width.

And, yes, please send plain text email to R-help. Sending HTML email reduces the likelihood anyone will actually read your email.

-Don

--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
Lab cell 925-724-7509
 
 

On 5/3/18, 6:28 PM, "R-help on behalf of sunyeping via R-help" <r-help-bounces using r-project.org on behalf of r-help using r-project.org> wrote:

    When I check the size of the plot region usingdev.size("in")a new plot region is produced and in the Rconsole I get[1] 5.333333 5.322917If I mean to produce a plot region with size setting bydev.new(length=3,width=3)a plot region is produced, but the size is [2.281250, 5.322917], as detected by the de.size function. If I type:dev.new(length=10,width=10)I get a plot region of with the size of [7.614583, 5.322917]. It seems that the width of the new plot region cannot be set, and tt is always 5.322917. The length of the new plot region can be set, but it is always smaller that the values I set.What do I miss? What is the correct way of setting the dimension of the new plot region? I will be grateful to any help.Best regards,
    
    	[[alternative HTML version deleted]]
    
    ______________________________________________
    R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
    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.
    



More information about the R-help mailing list