Polar Histogram
Examples
- Basic example of polar histogram.
::
let theta = vector([
0.1, 1.1, 5.4, 3.4, 2.3, 4.5, 3.2,
3.4, 5.6, 2.3, 2.1, 3.5, 0.6, 6.1
])
polarhistogram(theta, 6)
Result:
.. image:: ../../../tests/imgs/polar_hist/polarHist_1.png :align: center :width: 360
::
var m0: Random = Random(0)
var m1: Random = Random(1)
let r1 = rand(m0, 100000, 0.0, 1.0)
let r2 = rand(m1, 100000, 0.0, 1.0)
let theta = apply2(r1, r2, {x:Float64, y:Float64 => atan((x-0.5)/(2.0*(y-0.5)))})
polarhistogram(theta, 25)
Result:
.. image:: ../../../tests/imgs/polar_hist/polarHist_2.png :align: center :width: 360
::
var m0: Random = Random(0)
var m1: Random = Random(1)
let r1 = rand(m0, 100000, 0.0, 1.0)
let r2 = rand(m1, 100000, 0.0, 1.0)
let theta = apply2(r1, r2, {x:Float64, y:Float64 => atan((x-0.5)/(2.0*(y-0.5)))})
let h = polarhistogram(theta, 25)
h.face_color("red")
h.face_alpha(0.7)
Result:
.. image:: ../../../tests/imgs/polar_hist/polarHist_3.png :align: center :width: 360
::
var m0: Random = Random(0)
var m1: Random = Random(1)
let r1 = rand(m0, 100000, 0.0, 1.0)
let r2 = rand(m1, 100000, 0.0, 1.0)
let theta = apply2(r1, r2, {x:Float64, y:Float64 => atan((x-0.5)/(2.0*(y-0.5)))})
let h = polarhistogram(theta, 25)
h.stairs_only(true)
Result:
.. image:: ../../../tests/imgs/polar_hist/polarHist_4.png :align: center :width: 360