Created
June 16, 2013 06:34
-
-
Save dwinter/5791053 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f <- function(x,y) sin(x)/cos(y) | |
x <- seq(-5,5,0.1) | |
y <- seq(-5,5,0.1) | |
df <- expand.grid(x,y) #all possible combinations of x and y | |
df$value <- apply(df, 1, function(x) f(x[1], x[2])) | |
p <- ggplot(df, aes(Var1,Var2,fill=res>0)) | |
p + geom_raster() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment