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
|
@ -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.
|
||||
````
|
||||
::::
|
Loading…
Add table
Add a link
Reference in a new issue