Advanced Plotting Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there anyway to interpolate 2d histogram results?

Dear Folks:

 

I recently started using the advanced plotting toolkit and found it fascinatingly good an option to plot high quality graph using LabView. However, when I perform 2D histogram, I hope I can have an option or at least the capabilities to interpolate the plot so that it is more smooth looking. 

At present, I can not output the raw 2d histogram data as an array otherwise I should be able to do something within LabView to fix it. 

Any ideas how I can have smoothed 2d histogram results in LabView?

 

Many thanks

 

Shuo

0 Kudos
Message 1 of 3
(5,359 Views)

Histograms should be blocky - they subdivide your data set into X number of bins.  If you want to see smoothed data then perhaps you don't want a 2D histogram but rather a 2D contour plot?

 

See - http://advancedplotting.github.io/docs/ref/Contour.html

 

 

0 Kudos
Message 2 of 3
(5,327 Views)

That's actually the good question (about some "smoothing" of the 2D Histogram, i.e. getting a 2D KDE). 

Contour plots are great, but one need to take a Z data somewhere, when to 2D Histogram you can just supply an X and Y vectors. 

This is exactly my case - I have a fairly large datasets (up to ~7M of XY points) which I wish to show on a smooth density plot. 

Histograms, as you mentioned, designed for different purpose. It would be ideal to get some kind of Kernel Density Estimate. Unfortunately, I can't find any good ready-made solution for LabVIEW for 2D KDE's calculation (otherwise I would just use ViewArray component for this). 

 

The good (and very fast) one KDE cruncher I've found here: https://bitbucket.org/lbl-cascade/fastkde/src/master/fastkde/ or https://kdepy.readthedocs.io/en/latest/index.html

 

In the attachments you can find an examples of the 64x64 bins 2D Histogram, fastKDE estimate, contour plot based on fastKDE, and KDE-like thing, basically gaussian-smoothed version of 2D Histogram. All pictures are present in black-white and colored versions (colored and scaled with ImageJ).

0 Kudos
Message 3 of 3
(4,404 Views)