hvplot icon indicating copy to clipboard operation
hvplot copied to clipboard

Add wind barbs plot method to hvplot

Open Copilot opened this issue 3 months ago • 0 comments

Adds ds.hvplot.barbs() method to support meteorological wind barb visualizations using GeoViews' WindBarbs element.

Changes

Converter (hvplot/converter.py):

  • Conditional import of WindBarbs from geoviews (falls back to VectorField placeholder)
  • Added 'barbs' to _kind_mapping, _kind_options, and _geo_types
  • Implemented barbs() converter method supporting both Cartesian (u, v) and polar (angle, mag) wind components
  • Parameter validation prevents mixing formats and ensures completeness

Plotting API (hvplot/plotting/core.py):

  • Added barbs() method to hvPlotTabular with comprehensive docstring
  • Registered 'barbs' in __all__ list

Tests:

  • Added TestWindBarbs class with 7 test cases covering valid usage and validation errors
  • Excluded 'barbs' from generic FRAME_TYPES (requires special parameters like vectorfield)

Usage

import pandas as pd
import hvplot.pandas

# Cartesian components
df.hvplot.barbs(x='lon', y='lat', u='u_wind', v='v_wind', geo=True)

# Polar components
df.hvplot.barbs(x='lon', y='lat', angle='direction', mag='speed', geo=True)

# Via kind parameter
df.hvplot(x='lon', y='lat', u='u_wind', v='v_wind', kind='barbs')

Requires geoviews package. Works with and without geographic projections.

[!WARNING]

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/holoviz/geoviews/pulls/805
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Add wind barbs as a method to hvplot</issue_title> <issue_description>Now that https://github.com/holoviz/geoviews/pull/805 is in, I think we can add ds.hvplot.barbs(...) to hvplot</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes holoviz/hvplot#1695

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot avatar Dec 10 '25 22:12 Copilot