6fbec8f3创建于 2022年6月24日历史提交

Fence

Examples

  1. Plotting the peaks function as a fence.

::

let x = linspace(-3.0, 3.0, num: 50)
let (X, Y, Z) = meshgrid(x, x, peaks)
fence(X, Y, Z)

Result:

.. image:: ../../../tests/imgs/fence/fence_1.png :align: center :width: 360

  1. Plotting the peaks function as a fence, with the color of each row set according to the mean value of that row.

::

let x = linspace(-3.0, 3.0, num: 50)
let (X, Y, Z) = meshgrid(x, x, peaks)
let row = Z.getRows()
let c = vector<Float64>(row, {i => mean(Z[i])})
fence(X, Y, Z, c)

Result:

.. image:: ../../../tests/imgs/fence/fence_2.png :align: center :width: 360

  1. Plotting a fence with custom edge color and face alpha.

::

let x = linspace(-5.0, 5.0, num:30)
let (X, Y, Z) = meshgrid(x, x, {x: Float64, y: Float64 => y * sin(x) - x * cos(y)})
fence(X, Y, Z).edge_color("b").face_alpha(0.5)

Result:

.. image:: ../../../tests/imgs/fence/fence_3.png :align: center :width: 360