Skip to content

Commit 1506ab0

Browse files
committed
center figures + small fixes
1 parent 00d6f02 commit 1506ab0

11 files changed

Lines changed: 43 additions & 12 deletions

File tree

control/frdata.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ class constructor, using the `frd` factory function, or
9797
Other Parameters
9898
----------------
9999
plot_type : str, optional
100-
Set the type of plot to generate with `plot()` ('bode', 'nichols').
100+
Set the type of plot to generate with `~FrequencyResponseData.plot`
101+
('bode', 'nichols').
101102
title : str, optional
102103
Set the title to use when plotting.
103104
plot_magnitude, plot_phase : bool, optional
@@ -857,12 +858,12 @@ def append(self, other):
857858

858859
# Plotting interface
859860
def plot(self, plot_type=None, *args, **kwargs):
860-
"""Plot the frequency response using a Bode plot.
861+
"""Plot the frequency response using Bode or singular values plot.
861862
862863
Plot the frequency response using either a standard Bode plot
863-
(default) or using a singular values plot (by setting `plot_type`
864-
to 'svplot'). See `bode_plot` and `singular_values_plot` for more
865-
detailed descriptions.
864+
(``plot_type='bode'``, default) or a singular values plot
865+
(``plot_type='svplot'``). See `bode_plot` and
866+
`singular_values_plot` for more detailed descriptions.
866867
867868
"""
868869
from .freqplot import bode_plot, singular_values_plot

control/nichols.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def nichols_grid(cl_mags=None, cl_phases=None, line_style='dotted', ax=None,
194194
:doc:`Matplotlib linestyle \
195195
<matplotlib:gallery/lines_bars_and_markers/linestyles>`.
196196
ax : matplotlib.axes.Axes, optional
197-
Axes to add grid to. If None, use `matplotlib.pyplot.gca()`.
197+
Axes to add grid to. If None, use `matplotlib.pyplot.gca`.
198198
label_cl_phases : bool, optional
199199
If True, closed-loop phase lines will be labelled.
200200

control/optimal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class OptimalControlProblem():
8484
will be broadcast by extension of the time axis.
8585
log : bool, optional
8686
If True, turn on logging messages (using Python logging module).
87-
Use `python.logging.basicConfig` to enable logging output
87+
Use `logging.basicConfig` to enable logging output
8888
(e.g., to a file).
8989
9090
Attributes
@@ -1216,7 +1216,7 @@ def create_mpc_iosystem(
12161216
`InputOutputSystem`.
12171217
log : bool, optional
12181218
If True, turn on logging messages (using Python logging module).
1219-
Use `python.logging.basicConfig` to enable logging output
1219+
Use `logging.basicConfig` to enable logging output
12201220
(e.g., to a file).
12211221
name : string, optional
12221222
System name (used for specifying signals). If unspecified, a generic

doc/classes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ some of the functions that can be used to convert objects from one class to
3333
another:
3434

3535
.. image:: figures/classes.pdf
36-
:width: 800
36+
:width: 800
37+
:align: center
3738

3839

3940
Response and plotting classes

doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
{'scipy': ('https://docs.scipy.org/doc/scipy', None),
105105
'numpy': ('https://numpy.org/doc/stable', None),
106106
'matplotlib': ('https://matplotlib.org/stable/', None),
107+
'python': ('https://docs.python.org/3/', None),
107108
}
108109

109110
# If this is True, todo and todolist produce output, else they produce nothing.

doc/config.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ System display parameters
159159
:value: True
160160

161161
If True, show the input, output, and state count when using
162-
`iosys_repr()` and the 'eval' format. Otherwise, the input,
162+
`iosys_repr` and the 'eval' format. Otherwise, the input,
163163
output, and state values are repressed from the output unless
164164
non-generic signal names are present.
165165

doc/iosys.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ diagram:
8383

8484
.. image:: figures/bdalg-feedback.png
8585
:width: 240
86+
:align: center
8687

8788
By default a gain of -1 is applied at the output of the second system,
8889
so the dynamics illustrate above can be created using the command

doc/nlsys.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ To illustrate the creation of a nonlinear I/O system model, consider a
5151
simple model of a spring loaded arm driven by a motor:
5252

5353
.. image:: figures/servomech-diagram.png
54-
:width: 240
54+
:width: 240
55+
:align: center
5556

5657
The dynamics of this system can be modeling using the following code::
5758

doc/optimal.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ length. This process is then repeated, resulting in a sampled data feedback
8484
law. This approach is illustrated in the following figure:
8585

8686
.. image:: figures/mpc-overview.png
87+
:width: 640
88+
:align: center
8789

8890
Every :math:`\Delta T` seconds, an optimal control problem is solved over a
8991
:math:`T` second horizon, starting from the current state. The first
@@ -286,7 +288,7 @@ Plotting the results::
286288
yields
287289

288290
.. image:: figures/steering-optimal.png
289-
291+
:align: center
290292

291293
An example showing the use of the optimal estimation problem and moving
292294
horizon estimation (MHE) is given in the :doc:`mhe-pvtol Jupyter

doc/phaseplot.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ The default method for generating a phase plane plot is to provide a
1919
ct.phase_plane_plot(sys, axis_limits, T)
2020

2121
.. image:: figures/phaseplot-dampedosc-default.png
22+
:align: center
2223

2324
By default, the plot includes streamlines generated from starting
2425
points on limits of the plot, with arrows showing the flow of the
@@ -44,6 +45,7 @@ an inverted pendulum system, which is created using a mesh grid::
4445
plt.ylabel(r"$\dot\theta$ [rad/sec]")
4546

4647
.. image:: figures/phaseplot-invpend-meshgrid.png
48+
:align: center
4749

4850
This figure shows several features of more complex phase plane plots:
4951
multiple equilibrium points are shown, with saddle points showing
@@ -75,6 +77,7 @@ are part of the :mod:`phaseplot` (pp) module::
7577
plt.gca().set_aspect('equal')
7678

7779
.. image:: figures/phaseplot-oscillator-helpers.png
80+
:align: center
7881

7982
The following helper functions are available:
8083

0 commit comments

Comments
 (0)