issues: 159791786
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
159791786 | MDU6SXNzdWUxNTk3OTE3ODY= | 880 | Possibility to provide default map background/ elements to plot | 13906519 | closed | 0 | 2 | 2016-06-11T20:11:25Z | 2019-02-26T17:51:16Z | 2019-02-26T17:51:16Z | NONE | Hi. Really enjoying xarray! Converting all my scripts and on the quest to simplify my plotting. For my current project I need loads of maps and generally add a land/ ocean layer and country boundaries as well as an default extent to the plot axes... I use for instance a extra layer like this: ``` import cartopy.crs as cars import cartopy.feature as feature default map backgroundscountries = cfeature.NaturalEarthFeature( category='cultural', name='admin_0_countries', scale='50m', facecolor='none') ``` An example from a class I work on right now: ```
``` This is a bit clumsy at the moment - I basically define the axes for each subplot (say 1..12 month), loop over them, select the axis and add them with ax.set_extent(), ax.add_feature() etc... This works, but I'd rather use the plot function within DataArray or DataSet... Also thinking about using FacetGrid instead of doing it manually. I thought about using the new decorators to patch this onto a custom plot directive but my Python is not really advanced enough for decorators and the inner functioning of array it seems... ``` @xr.register_dataarray_accessor('map') class MapDecorator(object): def init(self, xarray_obj): self._obj = xarray_obj
``` Not sure if this is a valid path or how one would do that? I would also like to have some default arguments (projection=) Cheers, Christian |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/880/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |