How to generate tabset-paned programmatically to plot charts in Quarto document

Using #| fig-align: center will cause tabsets to fail to generate.

Tabsets

:::{.panel-tabset}

#| results: asis
#| fig-align: center

iris |>
  dplyr::group_split(Species) |> 
  purrr::iwalk( ~{
    # create tabset for each group 
    cat( '### ', .y, ': Species "', unique( as.character(.x$Species) ), '"\n', sep = '' ) # tabset
    plot(x = .x$Sepal.Length, y = .x$Sepal.Width)
    cat('\n\n')
  })

pic1

:::

But #| fig-align: default generates tabsets. Why such a strange result, which is repeated in R markdown files.

pic2

I wonder what causes such different display and why

#| fig-align: center

causes such unusual output?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.