Skip to content

dq.mplstyle

mplstyle(*, usetex: bool = False)

Set custom Matplotlib style.

Warning

Documentation redaction in progress.

Examples

>>> x = np.linspace(0, 2 * np.pi, 101)
>>> ys = [np.sin(x), np.sin(2 * x), np.sin(3 * x)]

Before (default Matplotlib style):

>>> fig, ax = plt.subplots(1, 1)
>>> for y in ys:
...     ax.plot(x, y)
>>> ax.set(xlabel=r'$x$', ylabel=r'$\sin(x)$')

mplstyle_before

After (dynamiqs Matplotlib style):

>>> dq.mplstyle()
>>> fig, ax = plt.subplots(1, 1)
>>> for y in ys:
...     ax.plot(x, y)
>>> ax.set(xlabel=r'$x$', ylabel=r'$\sin(x)$')

mplstyle_after