Skip to content

Matplotlib deprecation warning #183

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

Closed
roryyorke opened this issue Jan 6, 2018 · 1 comment
Closed

Matplotlib deprecation warning #183

roryyorke opened this issue Jan 6, 2018 · 1 comment
Milestone

Comments

@roryyorke
Copy link
Contributor

see, e.g.,

https://travis-ci.org/python-control/python-control/jobs/325460249#L2815

The warning says:

test_siso (control.tests.freqresp_test.TestFreqresp) ... /home/travis/miniconda/envs/test-environment/lib/python3.6/site-packages/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: Adding an axes using the same arguments as a previous axes currently reuses the earlier instance.  In a future version, a new instance will always be created and returned.  Meanwhile, this warning can be suppressed, and the future behavior ensured, by passing a unique label to each axes instance.
@murrayrm
Copy link
Member

This has been fixed in PR #187. The issue is a planned change in the behavior of the matplotlib axes command (which is called by matplotlib.subplot in control.bode_plot and control.gangof4_plot). In the old behavior, if you called axes or subplot with the same argument, you got a pointer to the previous object. This behavior is not desired and so it is being deprecated. Details in matplotlib PR #9037.

What generated this behavior in the test suit was that we called bode twice in a row in the unit test and this caused matplotlib.pyplot.subfig to get called with the same arguments. The fix was to add a randomly generated internal "label" (not displayed anywhere), as described in the warning message.

@murrayrm murrayrm closed this as completed Feb 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants