8000 center figures + small fixes · murrayrm/python-control@154a3c0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 154a3c0

Browse files
committed
center figures + small fixes
1 parent 6e0dd54 commit 154a3c0

File tree

11 files changed

+43
-12
lines changed

11 files changed

+43
-12
lines changed

control/frdata.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ class constructor, using the `frd` factory function, or
9999
Other Parameters
100100
----------------
101101
plot_type : str, optional
102-
Set the type of plot to generate with `plot()` ('bode', 'nichols').
102+
Set the type of plot to generate with `~FrequencyResponseData.plot`
103+
('bode', 'nichols').
103104
title : str, optional
104105
Set the title to use when plotting.
105106
plot_magnitude, plot_phase : bool, optional
@@ -859,12 +860,12 @@ def append(self, other):
859860

860861
# Plotting interface
861862
def plot(self, plot_type=None, *args, **kwargs):
862-
"""Plot the frequency response using a Bode plot.
863+
"""Plot the frequency response using Bode or singular values plot.
863864
864865
Plot the frequency response using either a standard Bode plot
865-
(default) or using a singular values plot (by setting `plot_type`
866-
to 'svplot'). See `bode_plot` and `singular_values_plot` for more
867-
detailed descriptions.
866+
(``plot_type='bode'``, default) or a singular values plot
867+
(``plot_type='svplot'``). See `bode_plot` and
868+
`singular_values_plot` for more detailed descriptions.
868869
869870
"""
870871
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
@@ -195,7 +195,7 @@ def nichols_grid(cl_mags=None, cl_phases=None, line_style='dotted', ax=None,
195195
:doc:`Matplotlib linestyle \
196196
<matplotlib:gallery/lines_bars_and_markers/linestyles>`.
197197
ax : matplotlib.axes.Axes, optional
198-
Axes to add grid to. If None, use `matplotlib.pyplot.gca()`.
198+
Axes to add grid to. If None, use `matplotlib.pyplot.gca`.
199199
label_cl_phases : bool, optional
200200
If True, closed-loop phase lines will be labelled.
201201

control/optimal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class OptimalControlProblem():
8686
will be broadcast by extension of the time axis.
8787
log : bool, optional
8888
If True, turn on logging messages (using Python logging module).
89-
Use `python.logging.basicConfig` to enable logging output
89+
Use `logging.basicConfig` to enable logging output
9090
(e.g., to a file).
9191
9292
Attributes
@@ -1218,7 +1218,7 @@ def create_mpc_iosystem(
12181218
`InputOutputSystem`.
12191219
log : bool, optional
12201220
If True, turn on logging messages (using Python logging module).
1221-
Use `python.logging.basicConfig` to enable logging output
1221+
Use `logging.basicConfig` to enable logging output
12221222
(e.g., to a file).
12231223
name : string, optional
12241224
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)
0