home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 114576415 and user = 1217238 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • shoyer · 6 ✖

issue 1

  • Add a keyword to prevent divergent plot params · 6 ✖

author_association 1

  • MEMBER 6
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
155293871 https://github.com/pydata/xarray/issues/642#issuecomment-155293871 https://api.github.com/repos/pydata/xarray/issues/642 MDEyOklzc3VlQ29tbWVudDE1NTI5Mzg3MQ== shoyer 1217238 2015-11-10T05:13:36Z 2015-11-10T05:13:36Z MEMBER

@fmaussion any interest in putting together a pull request for seaborn or xray with some of these fixes?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add a keyword to prevent divergent plot params  114576415
154923196 https://github.com/pydata/xarray/issues/642#issuecomment-154923196 https://api.github.com/repos/pydata/xarray/issues/642 MDEyOklzc3VlQ29tbWVudDE1NDkyMzE5Ng== shoyer 1217238 2015-11-09T04:53:23Z 2015-11-09T04:53:23Z MEMBER

My point is, there should be a way to use vmin, vmax, and center together and have them all do what they are expected to.

Ahh. Yes, that's a good point. Totally agreed.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add a keyword to prevent divergent plot params  114576415
154915320 https://github.com/pydata/xarray/issues/642#issuecomment-154915320 https://api.github.com/repos/pydata/xarray/issues/642 MDEyOklzc3VlQ29tbWVudDE1NDkxNTMyMA== shoyer 1217238 2015-11-09T04:16:20Z 2015-11-09T04:52:11Z MEMBER

@mwaskom

center=False seems like it will collide with center=0 in surprising ways, but I agree that avoiding an additional kwarg would be ideal.

We already distinguish between center=None and center=0 inside the logic for color limits, so I don't think this would be too much worse.

I think it is still important to allow disabling automatic divergent plots, even without any specific settings of vmin and vmax. For example, suppose I want to visualize a bunch of variables in a loop. We already have an easy solution if I want all divergent plots (explicitly set center=0), but we don't have any easy way to signal that every plot should be sequential. Suppose I do want all sequential plots, but I'm happy to let the limits be different for each one (I'll add a colorbar). This scenario is actually pretty plausible if I'm plotting lots of different types of variables with very different units and scales (e.g., pressure, temperature, wind speed). I would rather not need to add explicitly vmin, vmax = data.min(), data.max() (or worse, vmin, vmax = np.nanpercentile(data, [2, 98]) to replicate the robust=True logic).

We could also add logic such that if both vmin and vmax are provided and center is not provided, a divergent colormap is never used. This seems pretty reasonable to me, given that providing both should be redundant in the case of a divergent colormap. However, I don't think this is a substitute for center=False, given the use case I describe above.

Finally, I do agree with @fmaussion that it is bad practice to override either vmin or vmax. I think this could be entirely independent of the default colormap logic, though. If only one of vmin/max is provided and the colormap is diverging, then the other should be determined by reflecting the limit around the center -- not by taking the largest distance from the center. If this results in data falling beyond the color limits, then so be it (in xray, this will be displayed with the extend argument on the colorbar). For example, suppose my data contains values between -10 and 100. If I plot it with vmin=-10 and vmax=None, then (1) we should detect diverging data with center=0 (unless center=False) and (2) we should infer vmax=10.

These three changes seems relatively straightforward to implement (if slightly more complex than what we currently have), but we won't really know until someone tries. If both of you guys think these are good ideas, then I would suggest @fmaussion should get started with a PR, either against seaborn or xray.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add a keyword to prevent divergent plot params  114576415
154919901 https://github.com/pydata/xarray/issues/642#issuecomment-154919901 https://api.github.com/repos/pydata/xarray/issues/642 MDEyOklzc3VlQ29tbWVudDE1NDkxOTkwMQ== shoyer 1217238 2015-11-09T04:44:40Z 2015-11-09T04:44:40Z MEMBER

Also, the ideal behavior really when you are plotting a diverging colormap and have provided vmin and vmax is to change the colormap itself so the breakpoint is at the data center but the limits are as provided.

Seaborn currently doesn't have any notion of "divergent" colormaps without breakpoints (beyond explicitly providing one with the cmap argument, but that doesn't trigger the divergent colormap logic currently). To be honest, I'm not sure there's a use case for that -- the only place where I would want to default a breakpoint is around zero, which is straightforward enough to signal with center=0.

For some reason I thought that was an implementation detail, although I'm having trouble pulling up a reference. Seems weird to test is False.

I agree it's weird and usually a code smell. But I have seen it used in a number of places, especially when it's useful to distinguish a boolean from a default value. For example, you can find it in both the numpy and pandas code bases: https://github.com/numpy/numpy/search?l=python&q=%22is+False%22&type=Code&utf8=%E2%9C%93 https://github.com/pydata/pandas/search?l=python&q=%22is+False%22&type=Code&utf8=%E2%9C%93

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add a keyword to prevent divergent plot params  114576415
154918112 https://github.com/pydata/xarray/issues/642#issuecomment-154918112 https://api.github.com/repos/pydata/xarray/issues/642 MDEyOklzc3VlQ29tbWVudDE1NDkxODExMg== shoyer 1217238 2015-11-09T04:31:55Z 2015-11-09T04:31:55Z MEMBER

I just mean practically, how do you tell the difference between 0 and False in Python code?

Use is: False is 0 is False, even on Python 2:

``` In [7]: False is 0 Out[7]: False

In [8]: 0 is 0 Out[8]: True

In [9]: False is False Out[9]: True ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add a keyword to prevent divergent plot params  114576415
153123881 https://github.com/pydata/xarray/issues/642#issuecomment-153123881 https://api.github.com/repos/pydata/xarray/issues/642 MDEyOklzc3VlQ29tbWVudDE1MzEyMzg4MQ== shoyer 1217238 2015-11-02T18:55:35Z 2015-11-02T18:55:35Z MEMBER

Agreed, this seems like a gap in the current logic. I copied the divergent colormap logic from Seaborn's heatmap, and if possible I would like to keep xray's logic here in sync. So it would also be nice to fix this upstream, if possible.

@mwaskom any thoughts on adding the divergent keyword to sns.heatmap? Or maybe it would be better to reuse center (e.g., center=False) to indicate that the colormap really shouldn't be divergent? The issue is that it's sometimes possible to get stuck with a divergent colormap even if you really don't want one.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Add a keyword to prevent divergent plot params  114576415

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