Merge pull request #834 from bnavigator/fix-sisotool-mpl-deprecation · python-control/python-control@55730b6

Original file line numberDiff line numberDiff line change

@@ -83,6 +83,12 @@ def test_sisotool(self, tsys):

8383

'margins': True

8484

}

8585
86+

# Check that the xaxes of the bode plot are shared before the rlocus click

87+

assert ax_mag.get_xlim() == ax_phase.get_xlim()

88+

ax_mag.set_xlim(2, 12)

89+

assert ax_mag.get_xlim() == (2, 12)

90+

assert ax_phase.get_xlim() == (2, 12)

91+
8692

# Move the rootlocus to another point

8793

event = type('test', (object,), {'xdata': 2.31206868287,

8894

'ydata': 15.5983051046,

@@ -116,6 +122,12 @@ def test_sisotool(self, tsys):

116122

assert_array_almost_equal(

117123

ax_step.lines[0].get_data()[1][:10], step_response_moved, 4)

118124
125+

# Check that the xaxes of the bode plot are still shared after the rlocus click

126+

assert ax_mag.get_xlim() == ax_phase.get_xlim()

127+

ax_mag.set_xlim(3, 13)

128+

assert ax_mag.get_xlim() == (3, 13)

129+

assert ax_phase.get_xlim() == (3, 13)

130+
119131

@pytest.mark.skipif(plt.get_current_fig_manager().toolbar is None,

120132

reason="Requires the zoom toolbar")

121133

@pytest.mark.parametrize('tsys', [0, True],