search for: geom_tiles

Displaying 20 results from an estimated 44 matches for "geom_tiles".

Did you mean: geom_tile
2011 Dec 09
3
ggplot with geom_tile
Dear R-users, I am trying to make a plot with ggplot-geom_tile(), but cannot remove some unwanted (white) lines through my plot. Below a reproducible example: ##### library(ggplot2) tot=as.data.frame(rep(seq(-50,50,5),each=21)) names(tot)="precip" temp=rep(seq(-5,5,0.5),21) tot$temp=temp disc=array(dim=c(21,21)) for(i in 1:21){ for(y in 1:21){ temp<-
2010 Nov 20
2
Merge two ggplots
...  plotdata<-melt(f)   names(plotdata)<-c('x','y','z')   v<-ggplot(plotdata, aes(x, y, z = z))   v + geom_tile(aes(fill=z)) } The first plot puts points and texts below the points... in an area while the second function in the same are fills the background using geom_tiles... Is it possible somehow to merge these two plots into one? So far I have tried to merge the two functions as one but I fail as ggplot is not very clear to me what it needs.      plotdata<-melt(f)   names(plotdata)<-c('x','y','z')   agent<-CRagent[[agentid]] #...
2007 Dec 13
2
use ggplot in a function to which a column name is given
Hi everyone, Hi ggplot users in particular, ggplot makes it very easy to plot things given their names when you use it interactively (and therefore can provide the names of the columns). qplot(x,foo,data=A) where A has columns (x,y,foo,bar) for example but I would like to use this from inside a function to which the name of the column is given. I cannot find an elegant way to make this
2011 Oct 21
0
geom_tile rendering problems
Hi, I'm trying to overlay a geographical map with a heat map by following the directions on http://pages.stern.nyu.edu/~achinco/programming_examples/Example__PlotGeographicDensity.html. However, the smaller my zoom level (the farther I zoom out), the more white horizontal lines I have interspersed in the tiled data after calling geom_tile. Is there any way around this? I tried setting the
2011 Aug 31
2
ggplot2 to create a "square" plot
Dear all, I am using ggplot with geom_tile to print as an image a matrix  I have. My matrix is a squared one of 512*512 cells.  The code that does that is written below > print(v + geom_tile(aes(fill=dB))+ opts(axis.text.x=theme_text(size=20),axis.text.y=theme_text(size=20), axis.title.x=theme_text(size=25) , axis.title.y=theme_text(size=25), legend.title=theme_text(size=25,hjust=-0.4) ,
2010 Apr 27
1
ggplot2 - help with intervals in geom plot
Hi; I have created a geom_tile plot which does roughly what I want but I have a small tweak I cannot sort out. I have a dataframe binL, binR, HCount, HProbCount where HCount and HProbCount have values ranging from 1-150. I plot binL and binR on the axes respectively and create two charts with the fill being represented by HCount and HProbCount respectively. The problem is that I want
2007 Jul 13
1
Choosing the number of colour breaks in ggplot2
A seemingly simple problem has me stumped. Is it possible to choose the number of colour breaks for a gradient scale in the current version of ggplot2? Here is a simple example: --------------------------------------------- x=-10:10 y=-10:10 dat=expand.grid(x=x,y=y) dat$z=dat$x^2+dat$y^2-100 ggplot(dat, mapping=aes(x=x, y=y, fill=z)) + geom_tile() + scale_fill_gradient2()
2008 Feb 05
2
using image to show RGB image data ?
Hello all, I'm now using image() to show image data (in my case dumps of SOM weights) but would like to show RGB colour data, not just single "z" colour values. I've currently been using seq() to skip 4 values, so I can show the R, G or B channels separately as "z". But is there a way I can show all three channels simultaneously as a proper colour image? Thanks, B.
2011 Jul 28
1
ggplot2 help/suggestions needed
Hello, I have written a version of the Kohenen Self Organizing Map (in R) and wish to use ggplot2 for the visualization. My results are RGB values in a matrix [x,y,1:3] where x and y comprise the first two dimensions and the third dimension is the RGB vector. I am not sure whether to use geom_tile or geom_hex as there really is no binning at the finest granularity. For testing, the matrix is
2011 Jul 15
2
plot a vertical column of colored rectangles
Hi, I've been really struggling with this. If I have a vector like dat <- c(0,0,0,0,1,1,1,0,0,0,1,1,0,0,0,1,0,0,0) I want to plot each element as a colored rectangle (red=1, blue=1) in the right order, so they all stack up forming a vertical column on the graph. Sort of like a building, with each floor in the appropriate color. Any ideas? I've tried using ggplot and geom_tile, but my
2009 Mar 05
1
Using vectors of names in calls for functions
Dear R people, it is a pleasure to try and use functionnalities that are in ggplot, even with my poor capacities in R. so far, i'dlike to be able to use these in my own function, and to "be able to use it repeatedly from vectors where I store the names of my columns." I have understood that this is a very discussed topic, that many post have been exhanged but I cannot understand
2017 Dec 20
2
outlining (highlighting) pixels in ggplot2
Using the small reproducible example below, I'd like to know if one can somehow use the matrix "sig" (defined below) to add a black outline (with lwd=2) to all pixels with a corresponding value of 1 in the matrix 'sig'? So for example, in the ggplot2 plot below, the pixel located at [1,3] would be outlined by a black square since the value at sig[1,3] == 1. This is my first
2010 Feb 04
2
ggplot2 / time series with different scales
I am trying to plot this dataset using ggplot2: df <- data.frame( sid = c(rep('11',30),rep('22',30)), time = rep(ISOdate(year = 2010, month = 1, day = 1:30),2), sales = c(rnorm(30, 1000, 20),rnorm(30, 900, 10)), price = c(rnorm(30, 2, 0.5),rnorm(30, 3,0.5)) ) Plotting just the sales can be done easily: ggplot(data=df, aes(x=time, y=sales, group=sid, color=sid)) +
2011 May 10
1
ggplot2 and add circle
Dear all, today I have writted the following code, to plot the contents of some matrices I have plot_shad_f function(f){ library(ggplot2) dev.new() plotdata<-melt(f) names(plotdata)<-c('x','y','z') v<-ggplot(plotdata, aes(x, y, z = z)) print(v + geom_tile(aes(fill=z))) } I would like to ask your help add a small circle in this plotting. What would be
2011 Nov 08
3
ggplot2 reorder factors for faceting
Dear List I am trying to draw a heatmap using ggplot2. In this heatmap I have faceted my data by 'infection' of which I have four. These four infections break down into two types and I would like to reorder the 'infection' column of my data to reflect this. Toy example below: library(ggplot2) # test data for ggplot reordering genes <- (rep (c(rep('a',4),
2008 May 12
1
Converting qqplot2 qplot() to grammar?
Hello all, I've been using the following qplot command: qplot(pixX,pixY, data=som, geom="tile", fill=rgb) + scale_fill_identity() + opts(aspect.ratio = .75) + facet_grid(unitX ~ unitY) Now I would like to convert it into the explicit ggplot grammar, so I can remove the extras: axes, labels, background, borders, facet labels, and extra white-space around the plot. (If anyone has
2017 Dec 20
0
outlining (highlighting) pixels in ggplot2
Hi Eric, you can use an annotate-layer, eg ind<-which(sig>0,arr.ind = T) ggplot(m1.melted, aes(x = Month, y = Site, fill = Concentration), autoscale = FALSE, zmin = -1 * zmax1, zmax = zmax1) + geom_tile() + coord_equal() + scale_fill_gradient2(low = "darkred", mid = "white", high = "darkblue",
2011 Aug 02
3
Clean up a scatterplot with too much data
I'm working with a lot of data right now, but I'm new to R, and not very good with it, hence my request for help. What type of graph could I use to straighten out things like... http://r.789695.n4.nabble.com/file/n3711389/Untitled.png ...this? I want to see general frequencies. Should I use something like a 3D histogram, or is there an easier way like, say, shading? I'm sure these
2010 Jul 10
3
a very particular plot
Hi all, Thanks for the really great help I've received on this board in the past. I have a very particular graph that I'm trying to plot, and I'm not really sure how to do it. I think I should be able to use ggplot for this, but I'm not really sure how. I have a data.frame which contains fifty sub frames containing one hundred data points each. I can do a histogram of each of
2017 Jun 18
3
R_using non linear regression with constraints
I am not as expert as John, but I thought it worth pointing out that the variable substitution technique gives up one set of constraints for another (b=0 in this case). I also find that plots help me see what is going on, so here is my reproducible example (note inclusion of library calls for completeness). Note that NONE of the optimizers mentioned so far appear to be finding the true best