Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/dev-docs/feature-format-matrix/qmd-files/layout/fig-align/code-python-nocaption.qmd
3593 views
---
format:
  html:
    quality: 1
  pdf:
    quality: 0
  typst:
    quality: 2
  dashboard:
    quality: -1
  docx:
    quality: 0
  pptx:
    quality: -1
keep-typ: true
_quarto:
  tests:
    typst:
      ensureTypstFileRegexMatches:
        -
          - '#align\(right\)\[(\r\n?|\n)?#box'
        -
          - '#block\[(\r\n?|\n)?#align\(right\)\['
---


---

```{python}
#| fig-width: 3
#| fig-align: right

import matplotlib.pyplot as plt
import numpy as np

# Data for plotting
t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2 * np.pi * t)


fig, ax = plt.subplots()
fig.set_figwidth(2)
ax.plot(t, s)

ax.set(xlabel='time (s)', ylabel='voltage (mV)')
ax.grid()

plt.show()
```