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

Two issues in assignment 4 #15

Open
Q-Quan opened this issue May 15, 2023 · 5 comments
Open

Two issues in assignment 4 #15

Q-Quan opened this issue May 15, 2023 · 5 comments

Comments

@Q-Quan
Copy link

Q-Quan commented May 15, 2023

  1. When using the %matplotlib notebook magic, I don't get interactive graphs. Instead, in PyCharm, the graphs stay empty. And in Jupyter (in-browser), the graphs and control buttons appear, but I still cannot interact with them (click actions don't do anything).
  2. Running the_box.show_tradeoff() displays two identical graphs instead of just one.

Python 3.11.3 / PyCharm 2023.1 / macOS 13.3.1

@quaquel
Copy link
Owner

quaquel commented May 15, 2023

  1. why would you expect interactive graphs?
  2. do you follow up show_tradeoff with plt.show()?

@EwoutH
Copy link
Collaborator

EwoutH commented May 15, 2023

2. do you follow up show_tradeoff with plt.show()?

This he doesn't, I suspect the function both returns a figure / axes object, and calls plt.show().

Edit: Can't reproduce it though. Might be a Mac thing (I'm running Windows).

@Q-Quan a full Jupyter notebook in which this happens might help.

1. When using the %matplotlib notebook magic, I don't get interactive graphs.

I do, should look something like this:

Screenshot_860

@quaquel
Copy link
Owner

quaquel commented May 15, 2023

show_tradeoff only returns a figure and plt.show is not called within the function. If you don't follow up with plt.show(), at least on mac, this results in showing the figure twice.

@Q-Quan
Copy link
Author

Q-Quan commented May 16, 2023

  1. As in Ewout's screenshot, I would expect a figure with buttons. With the notebook opened in PyCharm, no figure appears at all; in an in-browser Jupyter notebook, these buttons would not do anything, as far as I could discover.
  2. It happens as you say, @quaquel. Is this intended behaviour, then?

@quaquel
Copy link
Owner

quaquel commented May 17, 2023

  1. No idea, I don't use interactive matpltolib figures.
  2. this is what happens in jupyter when you create a figure but don't call plot.

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

No branches or pull requests

3 participants