Image Matrix
Examples
- Basic image matrix.
::
let C = matrix<Float64>(
[[0.0, 2.0, 4.0, 6.0],
[8.0, 10.0, 12.0, 14.0],
[16.0, 18.0, 20.0, 22.0]])
image(C)
colorbar()
Result:
.. image:: ../../../tests/imgs/imagematrix/imagematrix1.png :align: center :width: 360
::
let C = matrix<Float64>(
[[0.0, 2.0, 4.0, 6.0],
[8.0, 10.0, 12.0, 14.0],
[16.0, 18.0, 20.0, 22.0]])
image(C, true)
colorbar()
Result:
.. image:: ../../../tests/imgs/imagematrix/imagematrix2.png :align: center :width: 360
::
let C = matrix<Float64>(
[[0.0, 2.0, 4.0, 6.0],
[8.0, 10.0, 12.0, 14.0],
[16.0, 18.0, 20.0, 22.0]])
image(5.0, 8.0, 3.0, 6.0, C)
colorbar()
Result:
.. image:: ../../../tests/imgs/imagematrix/imagematrix3.png :align: center :width: 360
::
let r = matrix<Float64>(
[[1.0, 2.0, 3.0],
[4.0, 5.0, 6.0],
[7.0, 8.0, 9.0]])
let r_new = r.apply({t => t * 25.5})
let g = matrix<Float64>(
[[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0]])
let b = matrix<Float64>(
[[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0],
[0.0, 0.0, 0.0]])
image(r_new, g, b)
Result:
.. image:: ../../../tests/imgs/imagematrix/imagematrix4.png :align: center :width: 360
::
let line = linspace(1.0, 3.0)
plot(line)
hold(true)
let C = matrix<Float64>(
[[1.0, 2.0, 3.0],
[4.0, 5.0, 6.0],
[7.0, 8.0, 9.0]])
let im = image(C)
im.alpha(0.5)
gca().y_axis().reverse(false)
Result:
.. image:: ../../../tests/imgs/imagematrix/imagematrix5.png :align: center :width: 360
Methods
========================= ================================= Function Description ========================= ================================= image() 4 functions Display array as image. ========================= =================================
Description ^^^^^^^^^^^
.. function:: imagesc(C)
:param C: Matrix<Float64>
Display array as image.
.. function:: imagesc(C, scaled_colorbar)
:param C: Matrix<Float64>
:param scaled_colorbar: Bool
Display array as image.
.. function:: imagesc(r, g, b)
:param r: Matrix<Float64>
:param g: Matrix<Float64>
:param b: Matrix<Float64>
Display 3 arrays as image.
.. function:: imagesc(x_min, x_max, y_min, y_max, C)
:param x_min: Float64
:param x_max: Float64
:param y_min: Float64
:param y_max: Float64
:param C: Matrix<Float64>
Show 2d-array as image.