similar to: Choosing the number of colour breaks in ggplot2

Displaying 20 results from an estimated 4000 matches similar to: "Choosing the number of colour breaks in ggplot2"

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
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),
2007 Jul 16
2
Different axis limits for each facet in ggplot2
Hi! Is it possible to have different axis limit for each facet in a ggplot2 plot? Here is an example: -------------------------------------------------------------- library(ggplot2) x=seq(-10,10,.1) y=cos(x) z=sin(x)*10 dat=melt(data.frame(x,y,z), id.var="x") qplot( x, value, data=dat, facets=variable~., geom="line" )
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",
2009 Nov 23
1
Natural colours for topographic data
Dear list members I'm currently working on some topographic (elevation) data, and was somewhat surprised that the 'topo.colors' and 'terrain.colors' are of little to no use here. The problem is that these functions only return a palette of colours; they don't map depth values to colours. So if I plot (using 'image', 'persp' or similar functions) and
2009 Oct 19
2
Possible bug in plot.POSIXct regarding x axis
I believe I have found a bug (or at least a misfeature) in plot.POSIXct. See the following example code. set.seed(1) x=seq(1,1e8,length=100)+round(runif(100)*1e8) y=as.POSIXct(x,origin="2001-01-01") plot(y) This plots some random (date)times against their indices. The y axis correctly shows appropriate values (years), but the x axis contains the single number '59:58' in the
2013 Feb 08
3
Border width on symbols plotted with the lattice package
Dear list members, I can't figure out how get 'xyplot' or 'dotplot' in the 'lattice' package to respect the 'lwd' value for specifying the border with for *symbols* (for lines it works fine). Example: ----- # Base graphics works fine (gives a 'fat? circle) plot(5, cex=10, pch=21, lwd=10) # But 'xyplot' or 'dotplot' doesn't
2008 Apr 22
2
Getting rid of borders on semi-transparent plotting symbols
R version 2.7.0 RC (2008-04-20 r45403) When using semi-transparent filled plotting symbols, the border of the symbol has a different (darker) colour than the interior: plot(0, 0, pch=19, col="#FF000022") (Saving this as a PDF and looking at it magnified may make it easier to see.) This is pretty annoying, since when plotting partially overlapping points, the border colour dominates,
2011 Feb 02
3
Applying multiple functions to one object
Dear list members, I recall seeing a convenience function for applying multiple functions to one object (i.e., almost the opposite of 'mapply?) somewhere. Example: If the function was named ?fun? the output of fun(3.14, mode, typeof, class) would be identical to the output of c(mode(3.14), typeof(3.14), class(3.14)) Is my memory failing me, or does such a function already exists in a
2009 Oct 30
1
Applying a function on n nearest neighbours
I'm having a problem where I have to apply a function to a subset of a variable, where the subset is defined by the n nearest neighbours of a second variable. Here's an example applied to the 'iris' dataset: $ head(iris) Sepal.Length Sepal.Width Petal.Length Petal.Width Species 1 5.1 3.5 1.4 0.2 setosa 2 4.9 3.0 1.4
2009 Nov 25
1
Kerning issues with CairoPDF
Dear list members I'm using CairoPDF to generate PDF (because of its font embedding and support for transparent colours). However, at least on my (Windows) system, the text it outputs seems to have completely wrong kerning. Here's an example: CairoPDF("test.pdf") plot(rnorm(100),xlab="Ovreset") dev.off() The v is (slightly) too far away from the O, it's much
2006 Sep 12
1
lattice cloud and conditional axis limits
I'm using the 'cloud' function in the 'lattice' package to produce multi-panel 3D scatter plots. The range of the values used vary much between each panel (especially on the z axis), so I wish the axis limits to be calculated based on the (conditional) data. Here's a minimal example: library(lattice) z=1:200 x=runif(200) y=runif(200) s=factor(rep(c(1,2),each=100))
2008 Apr 15
1
Text-based graphics/plots
When discussing statistics in e-mail based discussion groups, or in newsgroups, it is sometimes useful to include simple, text-based statistical graphics. Here is an example, a histogram (only useful with a fixed-width font, obviously). :..... ..:::::::::. .:::::::::::::::
2009 Dec 07
1
Subset of time observations where timediff > 60 secs
Dear list members I have a rather large vector (part of a data frame) giving the time (date + time, POSIXct) of observations. The times are irregular (with both small and large jumps) but increasing, and there are several millions of them. I now wish to reduce my data set, so that I only have observations which are at least (for example) 60 seconds apart. Basically, I need (all) the indices
2009 Jun 22
1
The gradient of a multivariate normal density with respect to its parameters
Does anybody know of a function that implements the derivative (gradient) of the multivariate normal density with respect to the *parameters*? It?s easy enough to implement myself, but I?d like to avoid reinventing the wheel (with some bugs) if possible. Here?s a simple example of the result I?d like, using numerical differentiation: library(mvtnorm) library(numDeriv) f=function(pars, xx, yy)
2004 Mar 23
2
Tool for cutting Ogg Vorbis files
Anybody know of a tool for cutting/trimming Ogg Vorbis files? I'm thinking of a tool similar to (the excellent) mp3DirectCut "http://www.rz.uni-frankfurt.de/~pesch/#mp3dc" tool, only for Vorbis. I've tried musiCutter, but it's to difficult/time-consuming to use. BTW, the mp3DirectCut author says this in his FAQ: Can you add Ogg Vorbis support? I would,
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
2008 May 30
1
Reducing space around lattice wireframe plots
Dear R-help. When plotting 3D wireframe plots with the lattice package, there is often a lot of space between the actual plot (i.e., cube) and panel borders. For a single wireframe, this is not a problem, but when plotting multiple wireframes, the wasted space decreases the size of the plots very much. Is there a way to decrease this space/margin? I could not find any information about it in
2009 Dec 10
2
R on Windows crashes when using certain characters in strings in data frames (PR#14125)
Full_Name: Karl Ove Hufthammer Version: 2.10.0 OS: Windows XP Submission from: (NULL) (93.124.134.66) I have found a rather strange bug in R 2.10.0 on Windows, where the choice of characters used in a string make R crash (i.e., Windows shows a dialogue saying that the application has a problem, and must be closed). I can reproduce the bug on two separate systems running Windows XP, and with
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) ,