home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 298481284

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
298481284 MDExOlB1bGxSZXF1ZXN0MTcwMTA4MjE1 1926 Add x,y kwargs for plot.line(). 2448579 closed 0     10 2018-02-20T06:04:35Z 2018-05-10T05:12:03Z 2018-03-05T22:14:46Z MEMBER   0 pydata/xarray/pulls/1926
  • [x] Partially closes #575
  • [x] Tests added
  • [x] Tests passed
  • [x] Fully documented, including whats-new.rst for all changes and api.rst for new API

Description

plot.line now supports both 1D and 2D DataArrays as input. I've changed some variable names to make code clearer: 1. set xplt, yplt to be values that are passed to ax.plot() 2. xlabel, ylabel are axes labels 3. xdim, ydim are dimension names

Example

This code ```z = np.arange(10) da = xr.DataArray(np.cos(z), dims=['z'], coords=[z], name='f')

xy = [[None, None], [None, 'f'], [None, 'z'], ['f', None], ['z', None], ['z', 'f'], ['f', 'z']]

f, ax = plt.subplots(2,4)

for aa, (x,y) in enumerate(xy): da.plot(x=x, y=y, ax=ax.flat[aa]) ax.flat[aa].set_title('x='+str(x)+ ' | '+'y='+str(y)) ```

yields

Feedback requested

Should I refactor out the kwarg checking?

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/1926/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 pull

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 10 rows from issue in issue_comments
Powered by Datasette · Queries took 1.005ms · About: xarray-datasette