Images¶
Weschke
25 January 2026
Matplotlib¶
#+name: fig-light-dark
#+begin_src python :exports none :results output file :var fname=(mpl-var "light-dark")
import numpy as np
import matplotlib.pyplot as plt
x = [-4, -3, -2, -1, 0, 1, 2, 3]
y1 = [-11.2, -11.6, -7.0, 3.2, 18.3, 39.0, 68.2, 125.0]
y2 = [-8.2, -8.3, -3.9, 7.3, 22.9, 47.3, 87.1, 136.2]
fig, ax = plt.subplots(1, 1, dpi=100, layout='constrained', figsize=[6.4*1.5/2, 4.8*1.5/2])
ax.plot(x, y1, '.-', label='15°C')
ax.plot(x, y2, '.-', label='20°C')
ax.legend()
ax.set_xlabel('Electrical current, A')
ax.set_ylabel('Temperature, °C')
ax.set_title('Characteristic curve of the peltier element')
#+end_src
#+attr_org: :width 400
#+RESULTS: fig-light-dark
[[file:light-dark.svg]]
#+name: fig-light-dark-drk
#+CALL: fig-light-dark[:var fname=(mpl-var "light-dark_drk") :prologue (by-backend (t (mpl-prologue "dark"))) :epilogue (by-backend (rst "fig.savefig(fname);print(fname, end='')") (t "fig.set_facecolor('#131416');plt.show()")) :results (by-backend (rst "output file") (t "none"))]()
#+attr_rst: :class only-dark
#+RESULTS: fig-light-dark-drk
#+name: fig-light-dark-lgt
#+CALL: fig-light-dark[:var fname=(mpl-var "light-dark_lgt") :prologue (by-backend (rst "") (t "")) :epilogue (by-backend (rst "fig.savefig(fname);print(fname, end='')") (t "plt.show()")) :results (by-backend (rst "output file") (t "none"))]()
#+attr_rst: :class only-light
#+RESULTS: fig-light-dark-lgt
Gnuplot¶
PlantUML¶
Auszug .. Auszug ..