7e1bd49a创建于 2022年9月17日历史提交

Polar Line Plot

  1. Basic polar plot.

::

let theta = linspace(0.0, 2.0 * PI64, num: 628)
let rho = theta.apply({t:Float64 => sin(2.0 * t) * cos(2.0 * t)})
polarplot(theta, rho)

Result:

.. image:: ../../../tests/imgs/polar/polarPlot_1.png :align: center :width: 360

  1. Polar plot of a spiral.

::

let theta_degree = linspace(0.0, 360.0, num: 50)
let rho = theta_degree.apply({t => 0.0005 * t})
let theta_rad = theta_degree.apply({t => t * PI64 / 180.0})

polarplot(theta_rad, rho)

Result:

.. image:: ../../../tests/imgs/polar/polarPlot_2.png :align: center :width: 360

  1. Two polar plots together, with different styles.

::

let theta = linspace(0.0, 6.0 * PI64)
let rho1 = theta.apply({t => t / 10.0})
let rho2 = theta.apply({t => t / 12.0})

polarplot(theta, rho1)
hold(true)
polarplot(theta, rho2, line_spec: "--")

Result:

.. image:: ../../../tests/imgs/polar/polarPlot_3.png :align: center :width: 360

  1. Polar plot with markers.

::

let rho = linspace(10.0, 70.0, num: 13)
polarplot(rho, line_spec: "-o")

Result:

.. image:: ../../../tests/imgs/polar/polarPlot_4.png :align: center :width: 360

  1. This example shows customizing labels on the :math:r-axis.

::

let theta = linspace(0.0, 2.0 * PI64)
let rho = theta.apply(sin)
polarplot(theta, rho)
gca().r_axis().limits(-1.0, 1.0)

Result:

.. image:: ../../../tests/imgs/polar/polarPlot_5.png :align: center :width: 360

  1. This example shows customizing the color of markers.

::

let theta = linspace(0.0, 2.0 * PI64, num:25)
let rho = theta.apply({t => t * 2.0})
polarplot(theta, rho, line_spec:"r-o")

.. image:: ../../../tests/imgs/polar/polarPlot_6.png :align: center :width: 360