home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where issue = 224846826 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 5

  • nbren12 3
  • shoyer 1
  • pollackscience 1
  • fmaussion 1
  • tom-andersson 1

author_association 3

  • CONTRIBUTOR 3
  • MEMBER 2
  • NONE 2

issue 1

  • FacetGrid with independent colorbars · 7 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
1097920752 https://github.com/pydata/xarray/issues/1387#issuecomment-1097920752 https://api.github.com/repos/pydata/xarray/issues/1387 IC_kwDOAMm_X85BcPDw tom-andersson 26459412 2022-04-13T11:07:49Z 2022-04-13T11:07:49Z NONE

Any updates on this? It would be great to have an option for multiple colorbars for each axis of the FacetGrid, rather than the default of one single colorbar for each axis. The main use case would be when different axes span different orders of magnitude. A global clim hides the variability of the smaller-scale axes.

@shoyer:

If your plots should have different colorbars, then arguably they should be different data variables in a Dataset.

I see the reasoning here. Could the solution be an xr.Dataset.plot.imshow method, which optionally takes a list of cmaps, that automatically produces a new colorbar for each data_var/axis?

In the meantime, manual subplot and colorbar construction with matplotlib works, but is annoying.

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  FacetGrid with independent colorbars 224846826
449431078 https://github.com/pydata/xarray/issues/1387#issuecomment-449431078 https://api.github.com/repos/pydata/xarray/issues/1387 MDEyOklzc3VlQ29tbWVudDQ0OTQzMTA3OA== pollackscience 5065341 2018-12-21T16:18:06Z 2018-12-21T16:18:06Z NONE

I like @shoyer 's suggestion as well. This would be very useful if the data being plotted are equal-sized images, in which case the colorbar could be dropped altogether as it no longer makes sense for them to share the same range.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  FacetGrid with independent colorbars 224846826
298081427 https://github.com/pydata/xarray/issues/1387#issuecomment-298081427 https://api.github.com/repos/pydata/xarray/issues/1387 MDEyOklzc3VlQ29tbWVudDI5ODA4MTQyNw== nbren12 1386642 2017-04-28T19:04:46Z 2017-04-28T19:04:46Z CONTRIBUTOR

I tend to agree with you @shoyer. In that case it would be nice to have a Dataset.plot convenience method for plotting all the variables in a Dataset. This method could handle all the annoying boiler plate associated with subplots/AxesGrid.

{
    "total_count": 8,
    "+1": 8,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  FacetGrid with independent colorbars 224846826
298079713 https://github.com/pydata/xarray/issues/1387#issuecomment-298079713 https://api.github.com/repos/pydata/xarray/issues/1387 MDEyOklzc3VlQ29tbWVudDI5ODA3OTcxMw== shoyer 1217238 2017-04-28T18:57:04Z 2017-04-28T18:57:04Z MEMBER

This does kind of go against the point of FacetGrid, which is to display facets of the same variables in a grid. If your plots should have different colorbars, then arguably they should be different data variables in a Dataset.

That said, this does seem similar in spirit to the sharex and sharey arguments. Maybe sharez or share_vlim would be appropriate arguments for changing this?

Squeezing multiple colorbars in will be a little trickier than just allowing colorbar limits to vary, but if it can be done in a sane fashion that doesn't make the existing code more complex I would be in support.

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  FacetGrid with independent colorbars 224846826
297997508 https://github.com/pydata/xarray/issues/1387#issuecomment-297997508 https://api.github.com/repos/pydata/xarray/issues/1387 MDEyOklzc3VlQ29tbWVudDI5Nzk5NzUwOA== nbren12 1386642 2017-04-28T13:27:59Z 2017-04-28T13:27:59Z CONTRIBUTOR

The AxesGrid API isn't actually that bad. See this

```python from mpl_toolkits.axes_grid1 import ImageGrid

import xarray as xr

fig = plt.figure(figsize=(6,2.5)) grid = ImageGrid(fig, 111, (1,2), axes_pad=.1, cbar_location='bottom', cbar_mode='each', cbar_pad=0.3, aspect=False, cbar_size='3%')

for (lab,data), ax, cax in zip(t.groupby('season'), grid, grid.cbar_axes): im = ax.contourf(data) cax.colorbar(im) ```

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  FacetGrid with independent colorbars 224846826
297982393 https://github.com/pydata/xarray/issues/1387#issuecomment-297982393 https://api.github.com/repos/pydata/xarray/issues/1387 MDEyOklzc3VlQ29tbWVudDI5Nzk4MjM5Mw== nbren12 1386642 2017-04-28T12:12:56Z 2017-04-28T12:12:56Z CONTRIBUTOR

whoops. accidentally hit the close button.

@fmaussion I was worried that would be the case. I think matplotlib's AxesGrid module is the appropriate tool to handle this use case. Unfortunately, I find the AxesGrid API pretty unpleasant for interactive use.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  FacetGrid with independent colorbars 224846826
297934889 https://github.com/pydata/xarray/issues/1387#issuecomment-297934889 https://api.github.com/repos/pydata/xarray/issues/1387 MDEyOklzc3VlQ29tbWVudDI5NzkzNDg4OQ== fmaussion 10050469 2017-04-28T08:03:06Z 2017-04-28T08:03:06Z MEMBER

Seems reasonable, although this would imply quite a lot of change in the current logic. For example, facetgrids share x and/or y axis:

If there is a colorbar in between, would you like to share axes?

The current way to do what you need is to do it manually:

ds = xr.tutorial.load_dataset('air_temperature') t = ds.air.groupby('time.season').mean(dim='time') f, (ax1, ax2) = plt.subplots(1, 2, figsize=(7, 3)) t.isel(season=0).plot(ax=ax1) t.isel(season=1).plot(ax=ax2)

As you see, this messes up with the layout so a call to tight_layout() is necessary.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  FacetGrid with independent colorbars 224846826

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 12.404ms · About: xarray-datasette