Repository: python-control/python-control

Issue:
Matplotlib join() deprecated; need to update sisotool
In doing the release for v0.9.3, I found the following warning in the logs:
```
/home/runner/work/python-control/python-control/control/sisotool.py:161: MatplotlibDeprecationWarning: The join function was deprecated in Matplotlib 3.6 and will be removed two minor releases later.
[3339](https://github.com/python-control/python-control/actions/runs/3808966270/jobs/6480141305#step:6:3340)
    ax_phase.get_shared_x_axes().join(ax_phase, ax_mag)
```
We should fix this at some point.

Comments:

Patch:
diff --git a/control/sisotool.py b/control/sisotool.py
index 2b735c0..8a3b3d9 100644
--- a/control/sisotool.py
+++ b/control/sisotool.py
@@ -158,9 +158,11 @@ def _SisotoolUpdate(sys, fig, K, bode_plot_params, tvect=None):
     ax_phase.set_xlabel(ax_phase.get_xlabel(),fontsize=label_font_size)
     ax_phase.set_ylabel(ax_phase.get_ylabel(),fontsize=label_font_size)
     ax_phase.get_xaxis().set_label_coords(0.5, -0.15)
-    ax_phase.get_shared_x_axes().join(ax_phase, ax_mag)
     ax_phase.tick_params(axis='both', which='major', labelsize=label_font_size)
 
+    if not ax_phase.get_shared_x_axes().joined(ax_phase, ax_mag):
+        ax_phase.sharex(ax_mag)
+
     ax_step.set_title('Step response',fontsize = title_font_size)
     ax_step.set_xlabel('Time (seconds)',fontsize=label_font_size)
     ax_step.set_ylabel('Output',fontsize=label_font_size)
diff --git a/doc/conf.py b/doc/conf.py
index 9611791..e2e4201 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -202,7 +202,7 @@ def linkcode_resolve(domain, info):
         linespec = ""
 
     base_url = "https://github.com/python-control/python-control/blob/"
-    if 'dev' in control.__version__ or 'post' in control.__version__:
+    if 'dev' in control.__version__:
         return base_url + "main/control/%s%s" % (fn, linespec)
     else:
         return base_url + "%s/control/%s%s" % (
diff --git a/pyproject.toml b/pyproject.toml
index 0800bd5..01b2155 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -11,6 +11,7 @@ name = "control"
 description = "Python Control Systems Library"
 authors = [{name = "Python Control Developers", email = "python-control-developers@lists.sourceforge.net"}]
 license = {text = "BSD-3-Clause"}
+readme = "README.rst"
 classifiers = [
     "Development Status :: 4 - Beta",
     "Intended Audience :: Science/Research",


Test patch:
diff --git a/control/tests/sisotool_test.py b/control/tests/sisotool_test.py
index d4a2910..fde5eba 100644
--- a/control/tests/sisotool_test.py
+++ b/control/tests/sisotool_test.py
@@ -83,6 +83,12 @@ class TestSisotool:
             'margins': True
         }
 
+        # Check that the xaxes of the bode plot are shared before the rlocus click
+        assert ax_mag.get_xlim() == ax_phase.get_xlim()
+        ax_mag.set_xlim(2, 12)
+        assert ax_mag.get_xlim() == (2, 12)
+        assert ax_phase.get_xlim() == (2, 12)
+
         # Move the rootlocus to another point
         event = type('test', (object,), {'xdata': 2.31206868287,
                                          'ydata': 15.5983051046,
@@ -116,6 +122,12 @@ class TestSisotool:
         assert_array_almost_equal(
             ax_step.lines[0].get_data()[1][:10], step_response_moved, 4)
 
+        # Check that the xaxes of the bode plot are still shared after the rlocus click
+        assert ax_mag.get_xlim() == ax_phase.get_xlim()
+        ax_mag.set_xlim(3, 13)
+        assert ax_mag.get_xlim() == (3, 13)
+        assert ax_phase.get_xlim() == (3, 13)
+
     @pytest.mark.skipif(plt.get_current_fig_manager().toolbar is None,
                         reason="Requires the zoom toolbar")
     @pytest.mark.parametrize('tsys', [0, True],