The Wayback Machine - https://web.archive.org/web/20220228092059/https://github.com/scikit-learn/scikit-learn/pull/22622
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

DOC Fix axes3d matplotlib deprecation warning #22622

Conversation

@koushikjoshi
Copy link
Contributor

@koushikjoshi koushikjoshi commented Feb 26, 2022

Reference Issues/PRs

Part of #22586

What does this implement/fix? Explain your changes.

Removes the warning message produced by matplotlib in examples/decomposition/plot_pca_iris.py.

The warning states: "Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6."

Replaced a line like this:

ax = Axes3D(fig, elev=elev, azim=azim, rect=[0, 0, 0.95, 1])

by:

ax = fig.add_subplot(111, projection="3d", elev=elev, azim=azim)
ax.set_position([0, 0, 0.95, 1])

as this was the recommended change to make in the reference issue.

Any other comments?

This is my first PR, so I'm sorry if there was any mistake in my submission. Please let me know if there are any changes, and I'll try my best to update accordingly.

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Thanks for the PR!

There is a linting issue. We need to remove:

from mpl_toolkits.mplot3d import Axes3D

Because it is not used anymore.

@koushikjoshi
Copy link
Contributor Author

@koushikjoshi koushikjoshi commented Feb 27, 2022

@thomasjpfan just removed the import statement as asked. Please let me know if there are any other changes. Thanks for being patient with my first PR.

@thomasjpfan thomasjpfan changed the title Fix axes3d matplotlib deprecation warning DOC Fix axes3d matplotlib deprecation warning Feb 27, 2022
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Thanks for the fix! LGTM

@thomasjpfan thomasjpfan merged commit 4fe72f7 into scikit-learn:main Feb 27, 2022
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants