Displaying 20 results from an estimated 29 matches for "extendrange".
2009 Jul 21
2
animated grid graphics
I need to make a fairly complex animated graphic and decided to use grid for it.
A very simple example of what I need:
##==============================================================================
library(grid)
grid.newpage()
pushViewport(plotViewport())
pushViewport(viewport(xscale = extendrange(c(0, 100)),
yscale = extendrange(c(0, 100))))
grid.xaxis()
grid.yaxis()
rectNames <- paste("r", 1:100, sep = "")
for (i in 1:100) {
grid.rect(x = unit(sample(0:100, 1), "native"),
y = unit(sample(0:100, 1), "native"),...
2018 Apr 25
1
extendrange(): suggested improvement
Hi,
I often need to extend the plot range to the right, but not to the
left (for example: not below 0 so that log = "x" still works...). This
could be a handy improvement of extendrange():
--- utils.R 2015-08-25 18:18:20.000000000 -0400
+++ utils.R 2018-04-25 17:21:25.000000000 -0400
@@ -30,6 +30,6 @@
## Purpose: extend a range by a factor 'f' - on each side
if(!missing(r) && length(r) != 2)
stop("'r' must be a \"range\",...
2014 Feb 03
1
seq range argument
Hello dear developers,
I find myself often having the result of "range" oder "extendrange", which I want to create a sequence with.
But "seq" needs two seperate arguments "from" and "two".
Could an argument "range" be added?
Otherwise I will have to create an object with the range (may come from a longer calculation), index twice from it and...
2017 Dec 19
3
DBG_VALUE insertion for spills breaks bundles
...BG_VALUE is inserted after it, but does not have the bundling flags set. This essentially means that if we start with a set of bundled instructions:
MI1 [BundledSucc=true, BundledPred=false]
MI2 [BundledSucc=false, BundledPred=true]
Where MI1 is a spill, and MI2 is a different instruction, after ExtendRanges we end up with
MI1 [BundledSucc=true, BundledPred=false]
DBG_VALUE MI [BundledSucc=false, BundledPred=false]
MI2 [BundledSucc=false, BundledPred=true]
Since this happens after the final instruction scheduling, it results in broken schedules. I believe setting the bundling flags before invoking...
2017 Dec 22
0
DBG_VALUE insertion for spills breaks bundles
...BG_VALUE is inserted after it, but does not have the bundling flags set. This essentially means that if we start with a set of bundled instructions:
MI1 [BundledSucc=true, BundledPred=false]
MI2 [BundledSucc=false, BundledPred=true]
Where MI1 is a spill, and MI2 is a different instruction, after ExtendRanges we end up with
MI1 [BundledSucc=true, BundledPred=false]
DBG_VALUE MI [BundledSucc=false, BundledPred=false]
MI2 [BundledSucc=false, BundledPred=true]
Since this happens after the final instruction scheduling, it results in broken schedules. I believe setting the bundling flags before invoking...
2011 Aug 02
1
lattice: index plot
...rnorm(10)
plot(y)
I don't want to specify the x's manually, as this could become
cumbersome when having multiple panels.
I tried something like
library(lattice)
mp <- function(x, y, ...) {
x <- 1:length(y)
panel.xyplot(x, y, ...)
}
pp <- function(x, y, ...) {
list(xlim = extendrange(1:length(y)), ylim = extendrange(y))
}
set.seed(123)
y <- rnorm(10)
xyplot(y ~ 1, panel = mp, prepanel = pp, xlab="Index")
but I was wondering whether there is a more straightforward way?
By the way, if I do not specify the ylim in the prepanel function the
plot is clipped, but read...
2010 May 14
2
help color coding map in R
...the colors don't match. Attached is the R dataset of my data. Please help me tweak the map so the colors are properly assigned.
# Get the entire US map for use later.
us.map <- map("state", plot = FALSE, fill = TRUE)
# Calculate the range of the map (with extra margins).
xl <- extendrange(us.map$range[1:2])
yl <- extendrange(us.map$range[3:4])
library(maps)
library(lattice)
library(latticeExtra)
library(RColorBrewer) # creates nice color schemes
library(classInt)
plotclr <- brewer.pal(nclr,"PuRd")
class <- classIntervals(NatSTSummaryHigh.abi$STMean, nclr, style...
2007 Dec 09
1
buglet in curve?
...on is to replace this ...
if (is.null(xlim))
delayedAssign("lims", {
pu <- par("usr")[1:2]
ll <- if (par("xlog"))
10^pu
else pu
if (par("xaxs") == "r")
extendrange(ll, f = -1/27)
else ll
})
with this ...
if (is.null(xlim))
delayedAssign("lims", {
pu <- par("usr")[1:2]
if (par("xaxs") == "r")
pu <- extendrange(pu, f = -1/27)
ll...
2008 Dec 17
1
Shrink Trellis margins settings (when printed to png file)
Dear R-experts,
I have two problems:
PROBLEM (1)
-----------
I want to produce a very small png file (35 x 18 px) that contains a
histogram without a figure region or margins, only the pure heights.
In the base graphic system this is simple:
png(filename = "hist.png", res = 72, width=35, height=18)
par(mar=c(0,0,0,0), oma=c(0,0,0,0))
hist(rnorm(100),
2009 Feb 10
1
lattice shingle with time and date format
Hi R-Users,
I have a time series of bivariate observations (x,y,t). I've
developed a few panel routines to explore certain aspects of the data,
and now would like to break the time series up into smaller chunks to
explore the temporal trends. I would like to know if anyone has any
experience breaking up time series with lattice.
Base graphics offers coplot, utilizing the
2012 Mar 23
3
[LLVMdev] DragonEgg 3.0 with GCC 4.7
...lass' without previous declaration
/usr/lib/gcc/x86_64-redhat-linux/4.7.0/plugin/include/tm-preds.h:191:68: error: invalid type in declaration before ';' token
/builddir/build/BUILD/dragonegg-3.0.src/src/Constants.cpp: In member function '{anonymous}::BitSlice {anonymous}::BitSlice::ExtendRange(SignedRange, llvm::TargetFolder&) const':
/builddir/build/BUILD/dragonegg-3.0.src/src/Constants.cpp:188:7: error: 'BYTES_BIG_ENDIAN' was not declared in this scope
/builddir/build/BUILD/dragonegg-3.0.src/src/Constants.cpp: In member function '{anonymous}::BitSlice {anonymous}::B...
2024 Jul 16
2
Automatic Knot selection in Piecewise linear splines
..."==" fm1
all.equal(predict(fm1, xx), predict(fm3, xx))
## BTW: The chosen knots and coefficients are
mat <- with(fm1, cbind(dirs, cuts=c(cuts), coef = c(coefficients)))
## Plots : fine grid for visualization: instead of xx <- seq(x[1], x[length(x)], length.out = 1024)
rnx <- extendrange(x) ## to extrapolate a bit
xx <- do.call(seq.int, c(rnx, list(length.out = 1200)))
cbind(f = f(xx),
sspl = predict(m.sspl, xx)$y,
mars = predict(fm1, xx)) -> fits
plot(x,y, xlim=rnx, cex = 1/4, col = adjustcolor(1, 1/2))
cols <- c(adjustcolor(2, 1/3),
adjustcolor(4,...
2024 Jul 26
1
Automatic Knot selection in Piecewise linear splines
...predict(fm1, xx), predict(fm3, xx))
>
> ## BTW: The chosen knots and coefficients are
> mat <- with(fm1, cbind(dirs, cuts=c(cuts), coef = c(coefficients)))
>
> ## Plots : fine grid for visualization: instead of xx <- seq(x[1], x[length(x)], length.out = 1024)
> rnx <- extendrange(x) ## to extrapolate a bit
> xx <- do.call(seq.int, c(rnx, list(length.out = 1200)))
>
> cbind(f = f(xx),
> sspl = predict(m.sspl, xx)$y,
> mars = predict(fm1, xx)) -> fits
>
> plot(x,y, xlim=rnx, cex = 1/4, col = adjustcolor(1, 1/2))
> cols <- c(adj...
2016 Dec 26
0
bug in the LiveDebugValues code?
...us namespace)::LiveDebugValues::OpenRangesSet&,
llvm::UniqueVector<(anonymous namespace)::LiveDebugValues::VarLoc>&) [clone
.isra.207] (in
/nix/store/06dpmfn74zrmman8nq8p96dg50lwbxhg-llvm-3.9.0-lib/lib/
libLLVM-3.9.so)
==27195== by 0x56A3EE5: (anonymous
namespace)::LiveDebugValues::ExtendRanges(llvm::MachineFunction&) [clone
.constprop.259] (in
/nix/store/06dpmfn74zrmman8nq8p96dg50lwbxhg-llvm-3.9.0-lib/lib/
libLLVM-3.9.so)
==27195== by 0x57214A0:
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (in
/nix/store/06dpmfn74zrmman8nq8p96dg50lwbxhg-llvm-3.9.0-lib/lib/
libLLV...
2011 Apr 05
1
how to label customized y axis when using lattice parallel parameter common.scale=TRUE
Dear all,
When I use parallel function in lattice package, I want to label the
y-axis with customized numbers. Like this:
parallel(~iris[1:4] | Species, iris,horiz=FALSE,common.scale=TRUE,
scales=list(y=list(at=c(0,2,3))))
But only "Min" label in the y-axis, nothing happened. Could anyone help me?
Thanks.
Regards,
Pengcheng Yang
2010 Jun 25
1
Lattice plotting question
Hi all,
I'm working on some plots using lattice (R 2.10.1), and have entered
the polish phase. I've produced a satisfactory pair of xyplots (
http://imgur.com/EyXGi.png), but would like to align the y-axes of the top
and bottom plots. I assume that I need to adjust axis padding or something,
but I can't figure this one out. Thanks for any help!
Dave
--
Post-doctoral Fellow
2011 Feb 04
1
axTicks.Rd documentation bug
?axTicks says:
usr: numeric vector of length four, defaulting to ?par("usr")?
giving horizontal (?x?) and vertical (?y?) user coordinate
limits.
but this is not how the function is implemented -- in fact 'usr' should
be a vector of length two corresponding to the appropriate elements of
par("usr") [1:2 if side is 1 or 3, 3:4 if side is 2 or
2010 Aug 30
1
lattice: limits in reversed order with relation="same"
Hi everybody,
I want an x-axis which has xlim=c(max, min) rather than xlim=c(min, max)
in order to reflect the type of the process (cooling):
library(lattice)
myprepanel <- function(x,y,...) list(xlim=rev(range(x)))
x <- rep(1:10, 100)
z <- factor(sample(10, 1000, T))
y <- rnorm(1000, x, as.numeric(z))
xyplot(y~x|z, scales=list(x="free"), prepanel=myprepanel)
This works
2009 May 24
1
filling area under a function line
...st be a function or an expression containing 'x'")
expr <- sexpr
if (is.null(ylab))
ylab <- deparse(sexpr)
}
if (is.null(xlim))
delayedAssign("lims", {
pu <- par("usr")[1L:2]
if (par("xaxs") == "r")
pu <- extendrange(pu, f = -1/27)
if (par("xlog"))
10^pu
else pu
})
else lims <- xlim
if (is.null(from))
from <- lims[1L]
if (is.null(to))
to <- lims[2L]
lg <- if (length(log))
log
else paste(if (add && par("xlog"))
"x",...
2024 Jul 09
1
Automatic Knot selection in Piecewise linear splines
How can I do automatic knot selection while fitting piecewise linear
splines to two variables x and y? Which package to use to do it simply? I
also want to visualize the splines (and the scatter plot) with a graph.
Anupam
[[alternative HTML version deleted]]