Skip to content

contents shortcode not working with altair plot  #12078

Open
@cderv

Description

@cderv

Discussed in #12075

Originally posted by laguill February 13, 2025

Description

Hello,

I am trying to rearrange the output of a chart made with altair.
As followed here https://quarto.org/docs/authoring/contents.html

The output is not displayed.
Is it only working with matplotlib ?

---
title: Rearrange altair chart content
format: html
---

## A section

Here we define a plot.

```{python}
#| echo: false
#| label: a-cell

import altair as alt
from vega_datasets import data

source = data.iowa_electricity()
alt.Chart(source).mark_area(opacity=0.3).encode(x="year:T", y=alt.Y("net_generation:Q").stack(None), color="source:N")
```

## Another section

Here we use the plot, inside a callout:

::: callout-note

## Note the following plot

{{< contents a-cell >}}

:::

``` </div>

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingearly-in-releaseAn issue that should be worked on early in the release (likely due to risk)jupytershortcodesissues related to shortcodes

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions