Giter Site home page Giter Site logo

Comments (3)

joshday avatar joshday commented on June 7, 2024

Hmm, there's an error with the multi-observation method, since this appears to work:

julia> fit!(g, data[1])
Group
├─ HeatMap: n=1 | value=(x = 0:10, y = -5:5, z = [0 0  0 0; 0 0  0 0;  ; 0 0  0 0; 0 0  0 0])
├─ Hist: n=1 | value=(x = 0:10, y = [0, 0, 0, 1, 0, 0, 0, 0, 0, 0])
└─ Hist: n=1 | value=(x = -5:5, y = [0, 0, 0, 0, 0, 0, 0, 0, 0, 1])

from onlinestats.jl.

stephancb avatar stephancb commented on June 7, 2024

Thanks, I changed the title. Then a more or less elegant workaround is

julia> fit!!(g, it) = foreach(x -> fit!(g, x), it)
fit!! (generic function with 1 method)
julia> fit!!(g, data); g
Group
├─ HeatMap: n=2 | value=(x = 0:10, y = -5:5, z = [0 0 … 0 0; 0 0 … 0 0; … ; 0 0 … 0 0; 0 0 … 0 0])
├─ Hist: n=2 | value=(x = 0:10, y = [0, 0, 0, 1, 0, 0, 0, 1, 0, 0])
└─ Hist: n=2 | value=(x = -5:5, y = [0, 0, 0, 1, 0, 0, 0, 0, 0, 1])

from onlinestats.jl.

stephancb avatar stephancb commented on June 7, 2024

For reference, closer to my real application is

julia> xydata(n) = ((5+randn(), randn()) for x in 1:n)
xydata (generic function with 1 method)
julia> g=Group(HeatMap(0.0:10, -5.0:5), Hist(0.0:10), Hist(-5.0:5))
Group
├─ HeatMap: n=0 | value=(x = 0.0:1.0:10.0, y = -5.0:1.0:5.0, z = [0 0 … 0 0; 0 0 … 0 0; … ; 0 0 … 0 0; 0 0 … 0 0])
├─ Hist: n=0 | value=(x = 0.0:1.0:10.0, y = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
└─ Hist: n=0 | value=(x = -5.0:1.0:5.0, y = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
julia> fit!!(g, it) = foreach(x -> fit!(g, x), it)
fit!! (generic function with 1 method)
julia> fit!!(g, map(z -> (z, z[1], z[2]), xydata(5_000_000))); g
Group
├─ HeatMap: n=5_000_000 | value=(x = 0.0:1.0:10.0, y = -5.0:1.0:5.0, z = [0 0 … 1 0; 0 10 … 6 0; … ; 0 16 … 7 1; 0 0 … 0 0])
├─ Hist: n=5_000_000 | value=(x = 0.0:1.0:10.0, y = [151, 6528, 106846, 679123, 1705893, 1707704, 680233, 106767, 6608, 146])
└─ Hist: n=5_000_000 | value=(x = -5.0:1.0:5.0, y = [151, 6644, 106620, 679893, 1707789, 1704820, 680415, 106955, 6552, 158])

It seems a very fast method for putting a large number of x-y data into both a heatmap and histograms of x and y.

from onlinestats.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.