Skip to content

Wind Barbs

barbs() over named columns of a dataframe_mojo DataFrame (#743). Each argument names a column instead of holding the values.

Wind Barbs

Usage

from dataviz import barbs
from dataviz import save

def main() raises:
    var x = List[Float64]()
    var y = List[Float64]()
    var u = List[Float64]()
    var v = List[Float64]()

    # A vertical cross-section of a sheared westerly: speed
    # climbs with altitude and backs slightly downwind.
    for row in range(5):
        for col in range(6):
            x.append(20.0 * Float64(col))
            y.append(0.5 * Float64(row))
            u.append(5.0 + 12.0 * Float64(row))
            v.append(3.0 * Float64(col) - 6.0)

    var c = barbs(
        x,
        y,
        u,
        v,
        title="Illustrative Wind Cross-Section (knots)",
        x_title="Distance downwind (km)",
        y_title="Altitude (km)",
    )
    save(c, "docs/src/examples/out_barbs.svg")

See Data shapes for shared input conventions.

Args:

  • df: The frame to read.
  • x: The numeric column for this channel.
  • y: The numeric column for this channel.
  • u: The numeric column for this channel.
  • v: The numeric column for this channel.
  • length: See the list overload.
  • flip: See the list overload.
  • theme: See the list overload.
  • width: See the list overload.
  • height: See the list overload.
  • title: See the list overload.
  • subtitle: See the list overload.
  • x_title: See the list overload.
  • y_title: See the list overload.

Related

Related charts: Parallel Coordinates · Vector Arrows

Relevant API: barbs