geoviews icon indicating copy to clipboard operation
geoviews copied to clipboard

VectorField only plots in certain projections

Open TeriForey opened this issue 5 years ago • 1 comments

I'm trying to plot vectors around the North pole and when I try to use the NorthPolarStereo projection, nothing is plotted. It does plot when I use a different projection like PlateCarree or Miller.

I'm using the following versions:

bokeh                     1.3.4                    py37_0    conda-forge
cartopy                   0.17.0          py37h929c6f0_1004    conda-forge
geoviews                  1.6.3                      py_0    pyviz
geoviews-core             1.6.3                      py_0    pyviz
holoviews                 1.12.5                     py_0    pyviz
python                    3.7.3                h93065d6_1    conda-forge

Example code:

import geoviews as gv
from geoviews import opts
from cartopy import crs
import numpy as np
gv.extension('bokeh')

lon = np.array([306.1017, 317.0930, 315.7377, 316.2712, 318.3051])
lat = np.array([60.5000, 61.5000, 59.5000, 60.5000, 60.5000])
ang = np.array([0.2048, 0.7487, 3.8524, 3.8675, 0.8121])
mag = np.array([1.0000, 0.3271, 0.5395, 0.1323, 0.8271])

vec = gv.VectorField((lon, lat, ang, mag)).opts(opts.VectorField(
    magnitude='Magnitude', color='Magnitude', rescale_lengths=False, pivot='tip', padding=0.1))

vec.opts(projection=crs.PlateCarree())  # works
vec.opts(projection=crs.NorthPolarStereo())  # doesn't plot anything

Is this a bug or is there something that I'm doing which isn't right? All other elements that I'm plotting (Points, Paths etc) work fine on the NorthPolar projection.

Thank you

TeriForey avatar Sep 27 '19 09:09 TeriForey

Probably down to this https://github.com/pyviz/geoviews/pull/296

philippjfr avatar Oct 08 '19 18:10 philippjfr