From 9bad93188196de507e31ad10a50177a4c6af9d24 Mon Sep 17 00:00:00 2001 From: Dylan Pulver Date: Thu, 12 Nov 2026 19:21:33 -0500 Subject: [PATCH 1/2] DOC: fix docstring parameters that the functions do not accept ControlPlot.set_plot_title documented `fig`, but the method takes (self, title, frame) and uses self.figure, so there is no way to pass it. The Parameters block came across from suptitle(), which is deprecated in favour of this method and does take fig. phase_plot documented `func`; the parameter was renamed to `odefun`, so the keyword form raised TypeError. --- control/ctrlplot.py | 2 -- control/phaseplot.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/control/ctrlplot.py b/control/ctrlplot.py index 50b2751d8..48efba7e8 100644 --- a/control/ctrlplot.py +++ b/control/ctrlplot.py @@ -195,8 +195,6 @@ def set_plot_title(self, title, frame='axes'): ---------- title : str Title text. - fig : Figure, optional - Matplotlib figure. Defaults to current figure. frame : str, optional Coordinate frame for centering: 'axes' (default) or 'figure'. **kwargs : `matplotlib.pyplot.suptitle` keywords, optional diff --git a/control/phaseplot.py b/control/phaseplot.py index 0fdb9922f..9ca05da8a 100644 --- a/control/phaseplot.py +++ b/control/phaseplot.py @@ -1257,7 +1257,7 @@ def phase_plot(odefun, X=None, Y=None, scale=1, X0=None, T=None, Parameters ---------- - func : callable(x, t, ...) + odefun : callable(x, t, ...) Computes the time derivative of y (compatible with odeint). The function should be the same for as used for `scipy.integrate`. Namely, it should be a function of the form dx/dt = F(t, x) that From ec4fd524c56290da8fbf5758ae41b2e462f76e4b Mon Sep 17 00:00:00 2001 From: Dylan Pulver Date: Thu, 12 Nov 2026 19:21:33 -0500 Subject: [PATCH 2/2] DOC: move the **kwargs description to _update_plot_title Per review: the passthrough was never dropped, it is simply not reachable through ControlPlot.set_plot_title. _update_plot_title is called from outside this module with arguments that land in **kwargs, so that is where the description belongs. It had no docstring, so the entries for its other parameters come from the module: fig from `if fig is None: fig = plt.gcf()`, frame from the wording already used in set_plot_title, and use_existing from the title-merging branch below. --- control/ctrlplot.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/control/ctrlplot.py b/control/ctrlplot.py index 48efba7e8..25652bd63 100644 --- a/control/ctrlplot.py +++ b/control/ctrlplot.py @@ -197,8 +197,6 @@ def set_plot_title(self, title, frame='axes'): Title text. frame : str, optional Coordinate frame for centering: 'axes' (default) or 'figure'. - **kwargs : `matplotlib.pyplot.suptitle` keywords, optional - Additional keywords (passed to matplotlib). """ _update_plot_title( @@ -538,6 +536,23 @@ def _make_legend_labels(labels, ignore_common=False): def _update_plot_title( title, fig=None, frame='axes', use_existing=True, **kwargs): + """Set or extend the centered title of a figure. + + Parameters + ---------- + title : str + Title text. + fig : Figure, optional + Matplotlib figure. Defaults to the current figure. + frame : str, optional + Coordinate frame for centering: 'axes' (default) or 'figure'. + use_existing : bool, optional + If True (default), extend the figure's existing title instead of + replacing it. + **kwargs : `matplotlib.pyplot.suptitle` keywords, optional + Additional keywords (passed to matplotlib). + + """ if title is False or title is None: return if fig is None: