Skip to content
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

Merged
merged 5 commits into from Jan 30, 2014
Merged

Create interpolation_methods.py #2599

merged 5 commits into from Jan 30, 2014

Conversation

@mdboom
Copy link
Member

mdboom commented Nov 18, 2013

Thanks for a contribution! A few comments. The examples/api directory is going away long term -- this should instead be in one of the more specific directories, probably examples/images_contours_and_fields.

This file should be PEP8 clean. (Use the pep8 tool to find violations).

@RutgerK
Copy link
Contributor Author

RutgerK commented Nov 18, 2013

@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.

ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::ETIMEDOUT: Connection timed out - connect(2) (https://rubygems.org/gems/formatador-0.2.4.gem)
The command "gem install travis-artifacts" failed and exited with 1 during before_script.

Your build has been stopped.

@pelson
Copy link
Member

pelson commented Nov 19, 2013

Triggered a re-build. Hopefully that will do the trick.


ax = ax.ravel()

for n, interp in enumerate(methods):
Copy link
Member

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):?

@pelson
Copy link
Member

pelson commented Jan 9, 2014

LGTM 👍 after a possible improvement to the iteration. This should certainly make it into v1.4.x.

@pelson
Copy link
Member

pelson commented Jan 14, 2014

@RutgerK - I'm keen to merge this, any chance you would be willing to update the example re my comment?

Update according Phils suggestion.
@RutgerK
Copy link
Contributor Author

RutgerK commented Jan 14, 2014

@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()
Copy link
Member

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.

@pelson
Copy link
Member

pelson commented Jan 14, 2014

sorry, i misunderstood how Github works and thought that you already applied the change

No probs. Welcome to github & matplotlib!

@RutgerK
Copy link
Contributor Author

RutgerK commented Jan 14, 2014

@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:
http://nbviewer.ipython.org/gist/RutgerK/8420591

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.

@pelson
Copy link
Member

pelson commented Jan 14, 2014

@RutgerK
Copy link
Contributor Author

RutgerK commented Jan 14, 2014

Sqeeuze is True by default, it would only affect when the array of axes is Mx1 or 1xN, which does not apply in this case.

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.

tacaswell added a commit that referenced this pull request Jan 30, 2014
Create interpolation_methods.py
@tacaswell tacaswell merged commit c154b90 into matplotlib:master Jan 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants