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

fix: Subplot in Chapter 1 gives Matplotlib warning #518

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kevinalh
Copy link

@kevinalh kevinalh commented Feb 24, 2021

Fix a Matplotlib 3.3 deprecation warning in the beginning of the Chapter 1 notebooks.

The exact warning is:

MatplotlibDeprecationWarning: Passing non-integers as three-element position specification is deprecated since 3.3 and will be removed two minor releases later.

image

The simple fix is done by using floor division with // so that the type is int and not float. Since it's the first chapter it's particularly important to keep it clean.

Kevin Languasco added 2 commits February 23, 2021 21:30
Fix a Matplotlib 3.3 deprecation warning given when the argument
type of the subplot function is a float instead of an int.
Copy link

@HVoltBb HVoltBb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although floor division works here, since we have an even number of elements in n_trials. I think the correct code should be a ceiling division, which works for both even and odd numbers.
Try the double inverted ceiling division: -(-len(n_trials)//2)

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.

2 participants