Figure.barb: Plot wind barbs in 2-D and 3-D

Open
#4,232 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@jjohnnystwsss is already working on this.

Since Nov 21, 2026.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

Start with the Figure.barb entry point and the linked GMT barb documentation, using the example input files and option checklist to map the wrapper scope. Done means an initial PyGMT implementation supports the stated 2-D and 3-D wind-barb plotting requirements and the documented options, with the tutorial or gallery example addressed as tracked work.

Written by the indexing model from the issue text.

Description

feature request help wanted

This issue serves as the central place for discussing and tracking the implementation of the Figure.barb() method in PyGMT. The issue will be closed when the initial implementation is complete. Progress is tracked at https://github.com/orgs/GenericMappingTools/projects/3.

Example

input data: barbs_strength.txt, barbs_direction.txt


import pygmt

pen_barb = "0.5p,darkorange"
fill_barb = "brown"

fig = pygmt.Figure()
fig.basemap(region=[-5, 5] * 2, projection="X10c", frame=0)

for barbs_data, use_word in zip(
    ["barbs_strength.txt", "barbs_direction.txt"], [1, 0]
):
    with pygmt.clib.Session() as session:
        session.call_module(
            'barb',
            '{} \
            -W{} \
            -G{} \
            -Q{}' \
            .format(barbs_data, pen_barb, fill_barb, '0.5c')
        )
    fig.text(barbs_data, offset="0c/-0.05c", justify="TC", font="5p", use_word=use_word)
fig.show()
Image

Documentation

GMT Option Flags and Modifieres

☑️: Implemented; ⬜: To be implemented/discussed; Strikethrough: Won't implement.

  • -R: region #XXX
  • -J: projection #XXX
  • -B: frame
  • -G: fill
  • -W: pen
  • -Q:
  • -C: cmap
  • -D:
  • -I:
  • -N: no_clip
  • -U: Use Figure.timestamp instead.
  • -X/-Y: Use Figure.shift_origin instead.
  • --PAR=value: Use pygmt.config instead.

Notes on Input Formats

Add any notes on the input formats, especially the meaning of columns.

Linked Pull Requests

  • Initial feature implementation #XXX
  • Add a tutorial or gallery example

Related Issues and Discussions

Add links to related wrapper discussions, API design threads, or upstream GMT changes here.

Dominant language
Python
Stars
882
Forks
261
Avg merge
1d 3h
Merged PRs (30d)
29

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GenericMappingTools/pygmt

All issues in GenericMappingTools/pygmt

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.