Refactor figures in documentation to use consistent syntax and improve layout; update myst.yml to remove obsolete output settings.
This commit is contained in:
parent
4b03461d1f
commit
df56660eb0
3 changed files with 18 additions and 34 deletions
|
@ -31,10 +31,9 @@ Ils génèrent donc un signal dit **binaire**.
|
|||
Un interrupteur (@inter) ou un détecteur de mouvement PIR (@pir) sont des capteurs
|
||||
tout ou rien.
|
||||
|
||||
::::{figure}
|
||||
:label: fig:capteur-tor
|
||||
:::{figure} https://upload.wikimedia.org/wikipedia/commons/3/3a/Switches-electrical.agr.jpg
|
||||
:label: inter
|
||||
:width: 50%
|
||||
|
||||
Interrupteur[^inter].
|
||||
|
||||
|
@ -44,6 +43,7 @@ Interrupteur[^inter].
|
|||
|
||||
:::{figure} https://upload.wikimedia.org/wikipedia/commons/2/2e/Motion_detector.jpg
|
||||
:label: pir
|
||||
:width: 50%
|
||||
|
||||
Détecteur de mouvement PIR[^pir].
|
||||
|
||||
|
@ -51,9 +51,6 @@ Détecteur de mouvement PIR[^pir].
|
|||
Public domain, via Wikimedia Commons.
|
||||
:::
|
||||
|
||||
Exemples de capteurs tout ou rien
|
||||
::::
|
||||
|
||||
## Les capteurs analogiques
|
||||
Le signal de sortie est en relation directe avec la grandeur d'entrée
|
||||
(généralement proportionnelle)
|
||||
|
@ -62,10 +59,9 @@ c'est un signal dit **analogique**.
|
|||
Une thermistance (@thermistance) ou une jauge de déformation (@jauge) sont des
|
||||
capteurs analogiques.
|
||||
|
||||
::::{figure}
|
||||
:label: fig:capteur-analogique
|
||||
:::{figure} https://upload.wikimedia.org/wikipedia/commons/3/3b/NTC_bead.jpg
|
||||
:label: thermistance
|
||||
:width: 50%
|
||||
|
||||
Thermistance : résistance variant selon la température[^thermistance].
|
||||
|
||||
|
@ -76,6 +72,7 @@ via Wikimedia Commons.
|
|||
|
||||
:::{figure} https://upload.wikimedia.org/wikipedia/commons/0/0a/Unmounted_strain_gauge.jpg
|
||||
:label: jauge
|
||||
:width: 50%
|
||||
|
||||
Jauge de déformation : résistance variant selon son élongation[^jauge].
|
||||
|
||||
|
@ -83,17 +80,13 @@ Jauge de déformation : résistance variant selon son élongation[^jauge].
|
|||
[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0), via Wikimedia Commons.
|
||||
:::
|
||||
|
||||
Exemples de capteurs analogiques.
|
||||
::::
|
||||
|
||||
## Les capteurs numériques
|
||||
Un capteur numérique génère un signal de sortie ne pouvant prendre qu'un certain nombre de valeur distincte, c'est à dire un signal **numérique**.
|
||||
Une caméra (@camera) ou un codeur absolu (@codeur) sont des capteurs numériques.
|
||||
|
||||
::::{figure}
|
||||
:label: fig:capteur-numerique
|
||||
:::{figure} https://upload.wikimedia.org/wikipedia/commons/0/02/S4000_Image_Sensor_%28Colorful%29.jpg
|
||||
:label: camera
|
||||
:width: 50%
|
||||
|
||||
Caméra : pour chaque pixel, le signal peut prendre une valeur entière allant de 0 à 255[^camera].
|
||||
|
||||
|
@ -101,12 +94,10 @@ Caméra : pour chaque pixel, le signal peut prendre une valeur entière allant d
|
|||
:::
|
||||
:::{figure} https://upload.wikimedia.org/wikipedia/commons/a/a8/Gray_code_rotary_encoder_13-track_opened.jpg
|
||||
:label: codeur
|
||||
:width: 50%
|
||||
|
||||
Codeur absolu : le signal prend une valeur entière différente selon l'angle du disque[^codeur].
|
||||
|
||||
[^codeur]: [Mike1024](https://commons.wikimedia.org/wiki/File:Gray_code_rotary_encoder_13-track_opened.jpg),
|
||||
Public domain, via Wikimedia Commons
|
||||
:::
|
||||
|
||||
Exemples de capteurs numériques
|
||||
::::
|
||||
:::
|
|
@ -36,9 +36,9 @@ On donne en @fig:exemple-can l'exemple d'un CAN de tension de référence 5 V fo
|
|||
|
||||
La **caractéristique** du CAN est la courbe représentant la valeur numérique en sortie en fonction de la valeur analogique en entrée (@fig:carac-can).
|
||||
|
||||
````{figure}
|
||||
::::{figure}
|
||||
:label: fig:exemple-can
|
||||
```{code-cell} python
|
||||
:::{code-cell} python
|
||||
:tags: [remove-input]
|
||||
import matplotlib.pyplot as plt
|
||||
from matplotlib import ticker
|
||||
|
@ -97,14 +97,14 @@ arr2 = ax2.annotate("", xy=(0.5, 0), xytext=(0.5, 1), arrowprops=dict(arrowstyle
|
|||
ax2.annotate("$q$", (1, 0.5), xycoords=arr2, ha="left", va="center")
|
||||
|
||||
arr3 = ax2.annotate("", xy=(1, 0), xytext=(1, 8), arrowprops=dict(arrowstyle="<->"))
|
||||
ax2.annotate("$V_{pe}$", (1, 0.5), xycoords=arr3, ha="left", va="center")
|
||||
```
|
||||
ax2.annotate("$V_{pe}$", (1, 0.5), xycoords=arr3, ha="left", va="center");
|
||||
:::
|
||||
Signal analogique et signal numérisé.
|
||||
````
|
||||
::::
|
||||
|
||||
````{figure}
|
||||
::::{figure}
|
||||
:label: fig:carac-can
|
||||
```{code-cell} python
|
||||
:::{code-cell} python
|
||||
:tags: [remove-input]
|
||||
import matplotlib.pyplot as plt
|
||||
from matplotlib import ticker
|
||||
|
@ -119,15 +119,12 @@ fig, ax = plt.subplots()
|
|||
ax.stairs(s_n, s_a, color="C1", lw=3, baseline=None)
|
||||
|
||||
ax.set(
|
||||
xlim=(0, 5),
|
||||
ylim=(-1, N),
|
||||
yticks=s_n,
|
||||
xlabel="Signal analogique (V)",
|
||||
ylabel="Signal numérique",
|
||||
)
|
||||
ax.set_xticks(s_a, [f"{v:.3f}" for v in s_a], rotation=45, ha="right", rotation_mode="anchor")
|
||||
ax.set_aspect(5/8, 'box')
|
||||
|
||||
ax.set_aspect(5/8, "datalim")
|
||||
arr4 = ax.annotate(
|
||||
"", xy=(s_a[0], 0), xytext=(s_a[1], 0), arrowprops=dict(arrowstyle="<->")
|
||||
)
|
||||
|
@ -136,7 +133,7 @@ ax.annotate("$q$", (0.5, 1), xycoords=arr4, ha="center", va="bottom")
|
|||
arr5 = ax.annotate(
|
||||
"", xy=(s_a[0], 1.5), xytext=(s_a[-1], 1.5), arrowprops=dict(arrowstyle="<->")
|
||||
)
|
||||
ax.annotate("$V_{pe}$", (0.5, 1), xycoords=arr5, ha="center", va="bottom")
|
||||
```
|
||||
ax.annotate("$V_{pe}$", (0.5, 1), xycoords=arr5, ha="center", va="bottom");
|
||||
:::
|
||||
Caractéristique du CAN.
|
||||
````
|
||||
::::
|
4
myst.yml
4
myst.yml
|
@ -21,10 +21,6 @@ project:
|
|||
- courstex
|
||||
numbering:
|
||||
headings: true
|
||||
settings:
|
||||
output_stderr: remove-error
|
||||
output_stdout: remove
|
||||
output_matplotlib_strings: remove
|
||||
site:
|
||||
template: book-theme
|
||||
options:
|
||||
|
|
Loading…
Add table
Reference in a new issue