Displaying 20 results from an estimated 46 matches for "rasterimage".
Did you mean:
laserimage
2010 Oct 01
1
colored rasterImage()
Hello,
I have been exploring the possibility to transition some code that
currently uses image() to use the new rasterImage(). To date, I
haven't been able to specify a color look-up strategy that works. For
example...
nx <- 100
ny <- 100
m <- matrix(data = rep(seq(0,1, length = nx), ny), ncol = nx, nrow =
ny, byrow = TRUE)
plot(1:nx, 1:ny, type = "n")
my.color <- matrix(data = (rainbo...
2010 Oct 01
2
strange interaction between rasterImage and Grid graphics
Dear all,
This may be specific to Mac, I haven't had a chance to test another
platform. Consider this,
plot(1,1,t="n")
rasterImage(matrix(1),1,1,1,1)
library(grid)
grid.rect(gp=gpar(fill="grey"))
The grid.rect covers the full device window as expected. However, when
I resize the window ever so slightly (interactive device) the rectGrob
is suddenly clipped to the previous plot window. I cannot understand
this behavio...
2011 Feb 09
2
using rasterImage within image
Has anyone yet tried incorporating rasterImage into the base image()
function? It seems to make a *huge* difference, with
a very small number of added/changed lines of code. (Of course I have
barely tested it at all.)
Is there any reason this *shouldn't* go into the next release?
> source("image.R")
> z <- matrix(run...
2011 Feb 15
1
Using rasterImage on a CairoWin device prevents adding further elements to device?
I was pointed to the Cairo package for plotting PNG images on a
device. I've been playing around with it, but found that after I use
the rasterImage function, I can't add anything any more to the device,
eg :
img <- readPNG(system.file("img", "Rlogo.png", package="png"))
r = as.raster(img[,,1:3])
r[img[,,4] == 0] = "white"
CairoWin()
plot(1:2,1:2,type="l")
rasterImage(r,1,1,2,2)
points(...
2010 Nov 17
1
rasterImage and coordinate conversion
Hi, I have a plot and I would like to overlay a PNG image over it. I'm
using the rasterImage function to do this, but the problem I'm facing
is working out the coordinates of the upper right corner of the final
image in user coordinates.
That is I can place the image so the lower left is located at the
bottom of the y-axis and the left end of the x-axis. Since my image is
say 100px x...
2010 Oct 18
1
Incorrect positioning of raster images on Windows
I am working on dumping raster data from R into PNG files using
rasterImage(). I am working with a test matrix from the rasterImage()
example and using it to produce a PNG image with the following code:
# From the example for rasterImage(). A 3 pixel by 5 pixel b/w checkerboard.
testImage <- as.raster(0:1, nrow=3, ncol=5)
testImage
[,1] [,2] [,3]...
2010 Oct 18
1
Incorrect positioning of raster images on Windows
I am working on dumping raster data from R into PNG files using
rasterImage(). I am working with a test matrix from the rasterImage()
example and using it to produce a PNG image with the following code:
# From the example for rasterImage(). A 3 pixel by 5 pixel b/w checkerboard.
testImage <- as.raster(0:1, nrow=3, ncol=5)
testImage
[,1] [,2] [,3]...
2020 Oct 02
1
What is the threshold for `useRaster` of graphics::image()?
Hi R-help list
What is the threshold for the `useRaster` argument of graphics::image()
to decide whether a grid is "regular" or not (i.e. the usage of
useRaster=T is allowed or not). My
`dev.capabilities("rasterImage")$rasterImage` is "yes".
I could not find this information in the internet. I also could not find
the source code of the graphics::image() function (I would answer the
question by myself then). Where can I find the source code?
Thanks a lot for any help and kind regards,
Chris
pac...
2013 Mar 02
1
Raster images and saving with original pixel dimensions in tiff, jpeg, or png perferablly.
Hello R-Help,
I want to be able to read in a raster image, plot it with grid.raster
or rasterImage and save the image with one pixel per a pixel element
from my array. Saved preferably in a common image format.
The real goal of my question is to eventually read in images with text
on them, manipulate them with my controlled functions, save them
without changing the image dimensions, and perform...
2014 Mar 20
0
possible bug: graphics::image seems to ignore getOption("preferRaster")
...I can see, the logic for
checking this is in image is broken here:
ras <- dev.capabilities("raster")
if (identical(ras, "yes"))
useRaster <- TRUE
because dev.capabilities("raster") returns a list like this (on my
machine, R.version in footer)
> $rasterImage
> [1] "yes"
You can test this by doing:
ras=structure(list(rasterImage = "yes"), .Names = "rasterImage")
identical(ras,'yes') # returns FALSE
so the test would need to be something like:
ras <- dev.capabilities("raster")[[1]]
if...
2011 Sep 18
2
Add png image outside plot borders
...plot borders of
some images I have created. I can use mtext() to add the written
portion, but I would like to have the Creative Commons license image
(http://en.wikipedia.org/wiki/File:Cc.logo.circle.svg) before the
text. I've found that I can plot a .png image inside the plot
boundaries using rasterImage() but I can't figure out how to do it
outside the boundaries.
Any help would be great. If you know unicode or Adobe Symbol encoding
for the CC logo, that might work too.
~Amelia McNamara
Statistics PhD student, UCLA
2011 Jun 13
3
plotting on an image
Hello all,
has someone please a few hints about how to
1.st: draw an image (preferrably a jpg) and then
2nd: plot() on that image
I am using a mac - and after searching and trying different ways (I have installed EBImage) I now would like to ask for help...
Thanks!
Johann
2011 Sep 23
1
spatstat => owin + image
...)
y1=floor(min(data[,3],na.rm=T )*(1-c))
y2=ceiling(max(data[,3],na.rm=T )*(1+c))
x1
x2
y1
y2
w = owin(c(x1,x2),c(y1,y2))
w
dat1 = as.ppp(data[,2:4],w)
is.ppp(dat1)
str(dat1)
#Get the plot information so the image will fill the plot box, and draw it
ima = readPNG("file.png")
lim = par()
rasterImage(ima, lim$usr[1], lim$usr[3], lim$usr[2], lim$usr[4])
par(new=T)
plot(dat1, use.marks=T)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thank you for any advice.
Kind Regards
TKD
--
View this message in context: http://r.789695.n4.nabble.com/spatstat-owin-image-tp3837023p3837023.html
Sent from the R help mai...
2010 Nov 29
1
Basic Question about Upgrading to Newer Version of R
...Everyone,
I'm using Ubuntu and used the Ubuntu Software Center to put R on my computer (version 2.10.1). It has been working great for what I've needed it for. However, I think now that I need a newer version so that a particular function in a new script I'd like to use can be found: rasterImage. My basic question is how do I upgrade from 2.10.1 to 2.12.0? The problems I'm running into include not having permission to change /usr/lib/R and not knowing how to specify a different version of R to be used when I've installed and compiled the newer version somewhere else on my compute...
2011 Nov 20
1
place values into a matrix efficiently?
...methods to perform the for-loop in the following sequence.
%xymat<-matrix(rep(0,100) nr=10,nc=10) # empty matrix
%x<-1:10
%y<-sample.int(10,10,rep=T)
%for (j in 1:10) xymat[x[j],y[j]] <- some_function(x[j],y[j]) #to create
either false-color or 3D map .
plot(0:1,0:1,t='n')
% rasterImage(xymat/max(xymat),0,0,1,1,interp=F)
This will produce a raster image of the original data(x vs y) that looks
like plot(x,y) .
Anyway, I just seem to be blanking: is there some vectorized way to
place values, or even a constant value, into all elements of xymat whose
row,col coordinates match or...
2013 Jul 24
1
R base package grid does not output raster image
Hi,
I don't think this is a remote desktop issue. I can run the following
code by remoting into both a Windows 7 machine and a Windows Server R2
machine. I can see the results on the Windows 7 machine but not the
server.
> library(grid)
> grid.raster(1:10/11)
Best regards,
Terry
Terry Seaward Risk Manager
T +27 21 416 1923
terry.seaward@investecmail.com
36 Hans Strijdom
2011 Feb 14
1
readPNG gives warnings and doesn't execute sample code from help files
Dear all,
I noticed in the latest R version (R.2.12.1) that the readPNG gives
following warning when running the example code in the help file (or
when using any other png for that matter) :
50: In rasterImage(img, 1.2, 1.27, 1.8, 1.73) :
Per-pixel alpha not supported on this device
No picture is shown, and code I used to be able to run, doesn't run any more.
> sessionInfo()
R version 2.12.1 (2010-12-16)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United States.1252...
2011 Nov 16
2
strange behavior from cex="*"
...t;- lapply(rownames(ff),readPNG)
png.to.img <- function(x) matrix(rgb(x[,,1],x[,,2],x[,,3]),
nrow=dim(x)[1],ncol=dim(x)[2])
imgs <- lapply(pngs,png.to.img)
par(mfrow=c(2,2))
lapply(imgs,function(x) {
plot(0:1,0:1,type="n",ann=FALSE,axes=FALSE)
rasterImage(x,0,0,1,1)
})
#########################
> sessionInfo()
R Under development (unstable) (2011-10-06 r57181)
Platform: i686-pc-linux-gnu (32-bit)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] glmmADMB_0.6.5 MASS_7.3-14...
2010 Nov 29
1
map() and pdf clipping
...ofile = paste("test-map", to.file,sep = ".")
do.call(to.file, list(file=ofile))
}
xr <- c(-185, -155)
yr <- c(45, 70)
map(xlim = xr, ylim = yr)
map.axes()
m <- matrix(seq(0, 1, length = 40*40), nrow = 40)
mr <- as.raster(m)
rasterImage(m, -180, 50, -160, 65)
map(xlim = xr, ylim = yr, fill = fill, add = TRUE)
if (!is.na(to.file)){
cat("wrote:", ofile, "\n")
dev.state <- dev.off()
}
}
###### END
> sessionInfo()
R version 2.12.0 (2010-10-15)
Platform: i386-apple-darwin9.8.0...
2011 Feb 16
3
image() with a vector
Hi,
I have a vectors x and z, for example,
x <- 0:20
z <- round(runif(20,1,7))
y <- 0.5
and I want to display z as an image. However if I then call image() with a vector
image(x,y,t(z),zlim=c(1,7),col=heat.colors(7),xlab="Year",ylab="Action",yaxt="n",xaxs="r",yaxs="r")
then I get the error
Error in image.default(x, y, t(z), zlim =