The R Project SVN R

Rev

Rev 84772 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 84772 Rev 84897
Line 1... Line 1...
1
 
1
 
2
R Under development (unstable) (2023-01-13 r83608) -- "Unsuffered Consequences"
2
R Under development (unstable) (2023-08-01 r84816) -- "Unsuffered Consequences"
3
Copyright (C) 2023 The R Foundation for Statistical Computing
3
Copyright (C) 2023 The R Foundation for Statistical Computing
4
Platform: x86_64-pc-linux-gnu (64-bit)
4
Platform: x86_64-pc-linux-gnu
5
 
5
 
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
7
You are welcome to redistribute it under certain conditions.
7
You are welcome to redistribute it under certain conditions.
8
Type 'license()' or 'licence()' for distribution details.
8
Type 'license()' or 'licence()' for distribution details.
9
 
9
 
Line 1055... Line 1055...
1055
+           main = "... panel.first = grid(3, lty = 1, lwd = 2), ..")
1055
+           main = "... panel.first = grid(3, lty = 1, lwd = 2), ..")
1056
+      }
1056
+      }
1057
+     )
1057
+     )
1058
> par(op)
1058
> par(op)
1059
> 
1059
> 
-
 
1060
> plot(1:64)
-
 
1061
> gr <- grid() # now *invisibly* returns the grid "at" locations
-
 
1062
> str(gr)
-
 
1063
List of 2
-
 
1064
 $ atx: num [1:7] 0 10 20 30 40 50 60
-
 
1065
 $ aty: num [1:7] 0 10 20 30 40 50 60
-
 
1066
> stopifnot(length(gr) == 2, identical(gr[[1]], gr[[2]]),
-
 
1067
+           gr[["atx"]] == 10*(0:6))
-
 
1068
> 
-
 
1069
> ## In log-scale plots :
-
 
1070
> plot(8:270, log="xy") ; grid() # at (1, 10, 100); if preferring "all" grid lines:
-
 
1071
> plot(8:270, log="xy") ; grid(equilogs = FALSE) -> grll
-
 
1072
> stopifnot(identical(grll, list(atx = c(1, 2, 5, 10, 20, 50, 100, 200),
-
 
1073
+                                aty = c(         10, 20, 50, 100, 200))))
1060
> 
1074
> 
1061
> 
1075
> 
1062
> 
1076
> 
1063
> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
1077
> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
1064
> cleanEx()
1078
> cleanEx()
Line 1911... Line 1925...
1911
[4,] 0.000 -0.273 -2.890  3.890
1925
[4,] 0.000 -0.273 -2.890  3.890
1912
> 
1926
> 
1913
> # (2) Add to existing persp plot - using trans3d() :
1927
> # (2) Add to existing persp plot - using trans3d() :
1914
> 
1928
> 
1915
> xE <- c(-10,10); xy <- expand.grid(xE, xE)
1929
> xE <- c(-10,10); xy <- expand.grid(xE, xE)
1916
> points(trans3d(xy[,1], xy[,2], 6, pmat = res), col = 2, pch = 16)
1930
> points(trans3d(xy[,1], xy[,2], z = 6,          pmat = res), col = 2, pch = 16)
1917
> lines (trans3d(x, y = 10, z = 6 + sin(x), pmat = res), col = 3)
1931
> lines (trans3d(x,      y = 10, z = 6 + sin(x), pmat = res), col = 3)
1918
> 
1932
> 
1919
> phi <- seq(0, 2*pi, length.out = 201)
1933
> phi <- seq(0, 2*pi, length.out = 201)
1920
> r1 <- 7.725 # radius of 2nd maximum
1934
> r1 <- 7.725 # radius of 2nd maximum
1921
> xr <- r1 * cos(phi)
1935
> xr <- r1 * cos(phi)
1922
> yr <- r1 * sin(phi)
1936
> yr <- r1 * sin(phi)