holoviz / holoviz/hvplot

vectorfield: 'x', 'y', 'mag' and 'angle' as default values

Open
#900 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
124
Avg merge
1d 18h
Merged PRs (30d)
1

Description

The current docstring of `vectorfield` claims `x`, `y`, `mag`, `angle` are optional. I don't find that.

```python
import hvplot.pandas
import pandas as pd
import numpy as np

data = pd.DataFrame(
dict(
x=[49.9, 50.0, 50.1, 50.2],
y=[50.2, 49.9, 50.0, 50.2],
angle=[2 * np.pi, np.pi, np.pi, np.pi],
mag=[0.01, 0.02, -0.02, -0.01],
)
)
data.hvplot.vectorfield()
```

```bash
AttributeError: 'DataFrame' object has no attribute 'coords'
```

For now I change the docstring to specify that parameters are mandatory. BUT it think it would be a very useful and logical extension of `points` that the defaults are set to 'x', 'y', 'mag', 'angle', i.e. that the above example would work.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.