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
Create interpolation_methods.py #2599
Conversation
Thanks for a contribution! A few comments. The This file should be PEP8 clean. (Use the pep8 tool to find violations). |
…urs_and_fields/interpolation_methods.py
@mdboom, thanks for pointing that out, i didnt know about the pep8 tool. I have used 'pep8 1.4.6' and it's (should be) clean now. edit: After the changes the Travis build fails for Python 3.3, the others are fine.
|
Triggered a re-build. Hopefully that will do the trick. |
|
||
ax = ax.ravel() | ||
|
||
for n, interp in enumerate(methods): |
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.
How about for ax, interp_method in zip(axes, methods):
?
LGTM 👍 after a possible improvement to the iteration. This should certainly make it into v1.4.x. |
@RutgerK - I'm keen to merge this, any chance you would be willing to update the example re my comment? |
Update according Phils suggestion.
@pelson, sorry, i misunderstood how Github works and thought that you already applied the change. I saw the email and thought it was fine so i didn't respond right away. I hope its does the trick... |
|
||
fig.subplots_adjust(hspace=0.3, wspace=0.05) | ||
|
||
ax = ax.ravel() |
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.
Think this needs to be removed, and the lines 31 and 32 use the ax variable from the loop.
No probs. Welcome to github & matplotlib! |
@pelson, you're right. But the axes array needs to be flattened somehow, otherwise the zipping doesn't work for me with Python 2.7 & mpl 1.3, see: We could use either axes.flat or axes.ravel(), and do it outside or inside the zip. I have no preference, although inside does seem a bit obscure. |
Squeeze might do the trick: http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.subplots |
Sqeeuze is True by default, it would only affect when the array of Could be a nice addition though, a sort of super-squeeze which forces a 1D array as results. Although for most cases axes.flat isn't a problem. |
Create interpolation_methods.py
Added an example as requested at:
http://stackoverflow.com/questions/14722540/smoothing-between-pixels-of-imagesc-imshow-in-matlab-like-the-matplotlib-imshow/14728122#comment29802965_14728122