Created
November 4, 2015 18:12
-
-
Save randyzwitch/fc2a24e93d4d4d8620f3 to your computer and use it in GitHub Desktop.
Plotting bivariate kde
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
using RDatasets, KernelDensity | |
faithful = dataset("datasets", "faithful"); | |
a = kde((faithful[:Eruptions],faithful[:Waiting])); | |
#How do I get cartesian product of x and y, such that it represents same coordinates as reshaped color? | |
x = collect(a.x) #256-element Array{Float64,1} | |
y = collect(a.y) #256-element Array{Float64,1} | |
color = reshape(a.density, 65536) #65536-element Array{Float64,1} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment