-
Notifications
You must be signed in to change notification settings - Fork 165
modernize matplotlib sections of interact notebook #188
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
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
2 similar comments
🎉❤️ |
@@ -25,7 +25,9 @@ | |||
{ |
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.
I don't follow where the note is pointing -- there is no interactive_plot
variable in the cell below,
Reply via ReviewNB
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.
Ugh, ReviewNB put all of the comments in the wrong place 🙄
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.
I updated the text.
@@ -25,7 +25,9 @@ | |||
{ |
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.
Does the line magic need to be used before every interactive plot or just once somewhere in the notebook?
Reply via ReviewNB
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.
Same as %matplotlib widget
(which should also work actually), it just has to be included before the plots you're making as per the docs.
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.
Does the line magic need to be used before every interactive plot or just once somewhere in the notebook?
Good question, just once per notebook
Same as %matplotlib widget
(which should also work actually),
widget
and ipympl
are direct aliases. I've been using ipympl
everywhere because it think it's more googleable for someone who comes across it. But I think that's mostly personal preference.
@@ -276,7 +276,7 @@ | |||
"source": [ |
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.
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.
Just a few minor changes, plus to conflict resolution. Looks good, and I'm glad to see us doing it the correct way now!
@@ -25,7 +25,9 @@ | |||
{ |
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.
Ugh, ReviewNB put all of the comments in the wrong place 🙄
"The function below plots a straight line whose slope and intercept are given by its arguments." | ||
"The function below plots a straight line whose slope and intercept are given by its arguments.\n", | ||
"\n", | ||
"The interactive below displays a line whose slope and intercept is set by the sliders. Note that if the variable containing the widget, `interactive_plot`, is the last thing in the cell it is displayed." |
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.
I don't see a variable called interactive_plot
"\n", | ||
"Here is a python function that, given $k$ and $p$, plots $f(x) = \\sin(k x - p)$.\n" | ||
"A better solution is to use the [ipympl](https://matplotlib.org/ipympl/) Matplotlib backend. You can activate this with the line magic: `%matplotlib ipympl`. Then in your interactive function you update the matplotlib artists." |
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.
Does the line magic need to be used before each plot or just once in the notebook?
environment.yml
Outdated
@@ -28,3 +28,4 @@ dependencies: | |||
- voila-vuetify=0.5.2 | |||
- voila-material=0.4.0 | |||
- vtk=8.2.0 | |||
- mpl_interactions |
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.
Do we want to specify a version?
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.
good point. I will update with the most recently released version 0.22.0
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.
Thanks for updating this!! I reviewed the interact notebook and made some small edits. Updated the environment.yml file to add mpl_interactions
. I didn't review the "More Libraries" section.
Thanks, merging! We'll finalize dependencies at the meeting later today. |
Signed-off-by: Itay Dafna <i.b.dafna@gmail.com>
Fix regression introduced in #188
Got a little bit longer - could definitely cut stuff out, but felt important to include the original section in order to contrast as otherwise it leaves you with the question of "well why not just do that?".
Could also consider moving
mpl-interactions
to the "other widget libraries" sectioncloses: #173
attn: @bsyouness