Displaying 3 results from an estimated 3 matches for "zmax1".
Did you mean:
max1
2017 Dec 20
2
outlining (highlighting) pixels in ggplot2
...nce the value at sig[1,3] == 1. This is my
first foray into ggplot2, and so far the googles hasn't helped me determine
if this is possible. Thanks, Eric
PS, my attempt to stretch the color scale such that (-1 * zmin) = zmax =
max(abs(m1)) has failed (i.e., ..., autoscale = FALSE, zmin = -1 * zmax1,
zmax = zmax1), any pointers on this would greatly appreciated as well.
# Import packages
library(ggplot2)
library(RColorBrewer)
library(reshape2)
m1 <- matrix(c(
-0.0024, -0.0031, -0.0021, -0.0034, -0.0060, -1.00e-02, -8.47e-03, -0.0117,
-0.0075, -0.0043, -0.0026, -0.0021,
-0.0015, -0.0076, -...
2017 Dec 20
1
outlining (highlighting) pixels in ggplot2
...pprecaite the guidance Eik, that works great! I'm also wondering if you
have any pointers for how I might stretch the color scale so that the max
and min values are the same? Right now, the min is -0.064 and the max is
something closer to 0.04. As you can see in what I sent, I tried adding:
zmax1 = max(abs(m1))
ggplot(..., autoscale = FALSE, zmin = -1 * zmax1, zmax = zmax1) + ...
to ggplot, but I'm either using the wrong arguments or have not added them
to the correct spot. I haven't been able to find the fix for this and
would very much appreciate any further guidance you can of...
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",
midpoint = 0)
+annotate("rect",ymin=ind[,"row"]-.5,ymax...