home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where author_association = "MEMBER" and issue = 158212793 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 2

  • fmaussion 4
  • shoyer 1

issue 1

  • Drawing only one contour · 5 ✖

author_association 1

  • MEMBER · 5 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
223709530 https://github.com/pydata/xarray/issues/866#issuecomment-223709530 https://api.github.com/repos/pydata/xarray/issues/866 MDEyOklzc3VlQ29tbWVudDIyMzcwOTUzMA== fmaussion 10050469 2016-06-03T22:26:50Z 2016-06-03T23:08:25Z MEMBER

@shoyer I thought that the colorbar was not very meaningful for contours, but I changed my mind.

[EDIT] I just updated the PR again. See the following example generated with the PR branch:

``` python import numpy as np import matplotlib.pyplot as plt import xarray as xr

x, y = np.meshgrid(np.arange(12), np.arange(12)) z = xr.DataArray(np.sqrt(x2 + y2)) ds = z.to_dataset(name='z')

f, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(6, 6)) ds.z.plot.contour(ax=ax1, levels=[4]) ds.z.plot.contour(ax=ax2, levels=[-1, 2, 4, 6, 8]) ds.z.plot.contour(ax=ax3, levels=[4], colors=['k']) ds.z.plot.contour(ax=ax4, levels=[2, 4, 6, 8], colors=['k', 'r', 'g', 'b']) plt.tight_layout() plt.show() ```

I think it's ok now, and the 1-level examples now run just fine.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Drawing only one contour 158212793
223702739 https://github.com/pydata/xarray/issues/866#issuecomment-223702739 https://api.github.com/repos/pydata/xarray/issues/866 MDEyOklzc3VlQ29tbWVudDIyMzcwMjczOQ== shoyer 1217238 2016-06-03T21:47:19Z 2016-06-03T21:47:19Z MEMBER

@fmaussion I would agree that if you pick a fixed color, then add_colorbar=False is a more sensible default choice. Why do you think that's a better choice in general?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Drawing only one contour 158212793
223638374 https://github.com/pydata/xarray/issues/866#issuecomment-223638374 https://api.github.com/repos/pydata/xarray/issues/866 MDEyOklzc3VlQ29tbWVudDIyMzYzODM3NA== fmaussion 10050469 2016-06-03T17:16:14Z 2016-06-03T17:16:14Z MEMBER

This PR should fix the issue. I now realize you were maybe willing to submit your own fix @JoyMonteiro ? Sorry if that was the case I can retract my PR.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Drawing only one contour 158212793
223628261 https://github.com/pydata/xarray/issues/866#issuecomment-223628261 https://api.github.com/repos/pydata/xarray/issues/866 MDEyOklzc3VlQ29tbWVudDIyMzYyODI2MQ== fmaussion 10050469 2016-06-03T16:34:26Z 2016-06-03T16:36:12Z MEMBER

Actually there are a couple of other things which are not OK with xarray's contour. For example:

``` python import numpy as np import matplotlib.pyplot as plt import xarray as xr

x, y = np.meshgrid(np.arange(12), np.arange(12)) z = xr.DataArray(np.sqrt(x2 + y2))

kw = {'levels':[2, 4, 6, 8], 'colors':['k']} f, (ax1, ax2) = plt.subplots(1, 2, figsize=(6, 3)) z.plot.contour(ax=ax1, kw) ax2.contour(z.values, kw) plt.show() ```

I'll try to have a look at what's going on. @xarraydevs, do you agree that add_colorbar should default to false when contour is used?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Drawing only one contour 158212793
223520490 https://github.com/pydata/xarray/issues/866#issuecomment-223520490 https://api.github.com/repos/pydata/xarray/issues/866 MDEyOklzc3VlQ29tbWVudDIyMzUyMDQ5MA== fmaussion 10050469 2016-06-03T08:26:00Z 2016-06-03T08:26:00Z MEMBER

Here's a mwe:

``` python import numpy as np import matplotlib.pyplot as plt import xarray as xr

x, y = np.meshgrid(np.arange(12), np.arange(12)) z = xr.DataArray(x2 + y2) z.plot.contour(levels=[10], add_colorbar=False) ```

which indeed doesn't plot anything.

Note that without add_colorbar=False, it crashes with:

python Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/mowglie/.pyvirtualenvs/oggm_pycharm/lib/python3.4/site-packages/xarray/plot/plot.py", line 452, in plotmethod return newplotfunc(**allargs) File "/home/mowglie/.pyvirtualenvs/oggm_pycharm/lib/python3.4/site-packages/xarray/plot/plot.py", line 426, in newplotfunc cbar = plt.colorbar(primitive, ax=ax, extend=cmap_params['extend']) File "/home/mowglie/.pyvirtualenvs/oggm_pycharm/lib/python3.4/site-packages/matplotlib/pyplot.py", line 2237, in colorbar ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw) File "/home/mowglie/.pyvirtualenvs/oggm_pycharm/lib/python3.4/site-packages/matplotlib/figure.py", line 1595, in colorbar cb = cbar.colorbar_factory(cax, mappable, **kw) File "/home/mowglie/.pyvirtualenvs/oggm_pycharm/lib/python3.4/site-packages/matplotlib/colorbar.py", line 1330, in colorbar_factory cb = Colorbar(cax, mappable, **kwargs) File "/home/mowglie/.pyvirtualenvs/oggm_pycharm/lib/python3.4/site-packages/matplotlib/colorbar.py", line 895, in __init__ ColorbarBase.__init__(self, ax, **kw) File "/home/mowglie/.pyvirtualenvs/oggm_pycharm/lib/python3.4/site-packages/matplotlib/colorbar.py", line 323, in __init__ self.draw_all() File "/home/mowglie/.pyvirtualenvs/oggm_pycharm/lib/python3.4/site-packages/matplotlib/colorbar.py", line 346, in draw_all X, Y = self._mesh() File "/home/mowglie/.pyvirtualenvs/oggm_pycharm/lib/python3.4/site-packages/matplotlib/colorbar.py", line 812, in _mesh y = self._uniform_y(self._central_N()) File "/home/mowglie/.pyvirtualenvs/oggm_pycharm/lib/python3.4/site-packages/matplotlib/colorbar.py", line 749, in _uniform_y automin = automax = 1. / (N - 1.) ZeroDivisionError: float division by zero

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Drawing only one contour 158212793

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 14.453ms · About: xarray-datasette