Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add mpl_interactions to 3rd party packages #18325

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

Merged
merged 2 commits into from
Aug 24, 2020

Conversation

ianhi
Copy link
Contributor

@ianhi ianhi commented Aug 23, 2020

PR Summary

Adds https://mpl-interactions.readthedocs.io/en/latest/ (github here) to the list of 3rd party packages. The main utility provided by the library is controlling the parameters to a function you plot using sliders or other widgets. At first, this was ipympl specific, but after some growing pains, it now works in any backend by using matplotlib sliders if not in a notebook. This made me feel ok renaming it from ipympl-interactions to mpl_interactions and including some things that independent of backend. For example, it provides the zoom_factory discussed in #18159 as well as some more idiosyncratic stuff such as the scalar figsize argument discussed in: #18244

The best single set of examples lives in https://mpl-interactions.readthedocs.io/en/latest/Gallery.html

Also for posterity: mega credit is due to @samanthahamilton who was super helpful in creating and improving the docs!

PR Checklist

  • na Has Pytest style unit tests
  • na Code is Flake 8 compliant
  • na New features are documented, with examples if plot related
  • (I hope, I can't even get master to build locally) Documentation is sphinx and numpydoc compliant
  • na Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • na Documented in doc/api/next_api_changes/* if API changed in a backward-incompatible way

I tried to build the docs to check for sphinx errors but I can't even get master to build :( so here's hoping

For the animation, I followed numpngw and made an apng. For full transparency here's the life course of that animation:

  1. Peek to create a gif
  2. ezgif.com to convert to apng
  3. compress with TinyPng

@ianhi
Copy link
Contributor Author

ianhi commented Aug 23, 2020

woops - I'd added and pushed a grammar fix but skipped the commit step. Just amended the commit

@timhoffm
Copy link
Member

270k ist still a call for the image. The page contains tenths of libraries and we don't want the user have to download megabytes of image data.

@ianhi
Copy link
Contributor Author

ianhi commented Aug 23, 2020

Just tried remaking it and got it down to 152.4 kB

I also ran the numpngw animation through tinypng which removed 330 kB so the page size would be net -150 kB would that work?

@ianhi
Copy link
Contributor Author

ianhi commented Aug 23, 2020

Got curious and ran a whole bunch of them through tinypng:
image

Would you like me to replace all, or a subset, of those images with the compressed versions?

@ianhi
Copy link
Contributor Author

ianhi commented Aug 23, 2020

Being more careful to actually get all the images in the 3rd party packages:
image
image

It looks as though there is ~1MB to be saved

@ianhi ianhi force-pushed the 3rd-party-packages branch from 2d1f7ca to d1bdfe4 Compare August 23, 2020 16:20
@ianhi
Copy link
Contributor Author

ianhi commented Aug 23, 2020

I went ahead and compressed them all, used a second commit in case that was not the right call. I also compressed the one jpg using tinyjpg.com. Finally, I inspected each image using the visual comparison in GitHub desktop and was unable to pick out any visual differences.

@tacaswell tacaswell added this to the v3.3-doc milestone Aug 24, 2020
@tacaswell
Copy link
Member

Looks good to me 👍

Thank you for taking the initiative to clean up the whole lot @ianhi ! The only argument I could see against compressing all of them is that it will bloat the repo, but compared to the test images this is noise.

@jklymak jklymak merged commit e93bda7 into matplotlib:master Aug 24, 2020
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Aug 24, 2020
@ianhi ianhi deleted the 3rd-party-packages branch August 24, 2020 14:36
jklymak added a commit that referenced this pull request Aug 24, 2020
…325-on-v3.3.1-doc

Backport PR #18325 on branch v3.3.1-doc (add mpl_interactions to 3rd party packages)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants