-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Feature plotting #466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature plotting #466
Conversation
a.plot() | ||
|
||
It may seem strange that | ||
the the values on the y axis are decreasing with -0.5 on the top. This is because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the the
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
# Lists need to be converted to np.arrays here. | ||
if not any(_right_dtype(np.array(x), plottypes) for x in args): | ||
raise TypeError('Plotting requires coordinates to be numeric ' | ||
'or dates. Try DataArray.reindex() to convert.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reindex
is not a method that converts string labels to numbers:
http://xray.readthedocs.org/en/stable/indexing.html#align-and-reindex
I would suggest DataArray.assign_coords
to assign new coordinate labels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@savefig plotting_example_time.png width=6in | ||
noise.plot_line() | ||
|
||
TODO- rotate dates printed on x axis. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't plotting well.
I'm going to get around to testing this out tomorrow. I just breezed through the docs and I have one comment. Can we not use
There is also a lively Github issue over here: matplotlib/matplotlib#875 I'll try to get a few more comments out tomorrow. So far, this work is really encouraging. |
I agree that One colorbar issue I find consistently annoying is having to manually |
@jhamman I'd be happy to bundle viridis with xray as the default colormap (the source code is here) -- or we could just wait a few months, at which time it will be the matplotlib default. @nbren12 Seaborn has some heuristics for picking sequential vs diverging colormaps. Possibly worth borrowing: https://github.com/mwaskom/seaborn/blob/v0.6.0/seaborn/matrix.py#L158 My inclination is to merge this on master and iterate in future PRs. There are still a few things to fix, but this is a great start. |
yeah, +1 for the |
|
||
distance = np.linalg.norm(xy, axis=2) | ||
|
||
distance = xray.DataArray(distance, zip(('y', 'x'), (y, x))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list(zip(..))
for python3 compatibility?
@clarkfitzg - I just spent some time running through your examples and trying to plot some of my own data. Overall - this is really slick and I really liked what you have going here. Below are a few comments I made along the way - take them or leave them.
|
Have you tried the ioos conda channel for cartopy? They do a really nice job maintaining builds. On Sat, Jul 18, 2015 at 11:30 AM, Joe Hamman [email protected]
|
Thanks for all the feedback! I'll change the default colormap and look into the other things mentioned on Monday. Re Python 3 compatibility with |
Agreed. Want to add a fix? |
Sure. I'll do it separate from this PR. |
Let's follow up on this with some smaller PRs. |
Seems like it used an old version of matplotlib, but it still worked. |
Not complete, but still ready for some feedback!
Docs are built here:
http://xray.readthedocs.org/en/feature-plotting/plotting.html
There are several TODOs around the docs and the code base. For some of these I'm requesting specific feedback.
Still need to: