home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 269546930

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/1171#issuecomment-269546930 https://api.github.com/repos/pydata/xarray/issues/1171 269546930 MDEyOklzc3VlQ29tbWVudDI2OTU0NjkzMA== 10050469 2016-12-28T21:52:38Z 2016-12-28T21:52:38Z MEMBER

I think this is a bug

Yes, I should've looked into this in more detail. So the problem is here. MaxNLocator.tick_values(vmin, vmax) does not guarantee to land on vmin or vmax exactly, which I think is confusing. It should be either changed or documented in xarray. The change could look like: if vmin and vmax are set explicitely, than we use linspace to build the levels.

Furthermore, MaxNLocator is no longer guaranteed to return a max of N levels in MPLv2, as shown by this simple test:

python import matplotlib as mpl ticker = mpl.ticker.MaxNLocator(7) levels = ticker.tick_values(4, 8) print('mpl: {}, nlevels: {}, levels: {}'.format(mpl.__version__, len(levels), levels))

Which prints, depending on mpl version:

mpl: 1.5.3, nlevels: 7, levels: [ 3.2 4. 4.8 5.6 6.4 7.2 8. ]

mpl: 2.0.0rc2, nlevels: 9, levels: [ 3.6 4.2 4.8 5.4 6. 6.6 7.2 7.8 8.4]

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  196278181
Powered by Datasette · Queries took 0.679ms · About: xarray-datasette