Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(quarto): address an issue where only the first plot is interactive when multiple plots are embedded #79

Closed
jooyoungseo opened this issue Aug 17, 2024 · 1 comment
Assignees

Comments

@jooyoungseo
Copy link
Member

If you render the following qmd file, only the first bar plot is interactive (without visual highlights). The second plot (heat map) is not interactive.

Reproducible Steps

  1. Create the following qmd file.

multiple_plots.qmd:

---
title: "maidr test"
format: html
---

## Barplot

```{python}
import matplotlib.pyplot as plt
import maidr
import seaborn as sns


# Load the penguins dataset
penguins = sns.load_dataset("penguins")

# Create a bar plot showing the average body mass of penguins by species
plt.figure(figsize=(10, 6))
b_plot = sns.barplot(
    x="species", y="body_mass_g", data=penguins, errorbar="sd", palette="Blues_d"
)
plt.title("Average Body Mass of Penguins by Species")
plt.xlabel("Species")
plt.ylabel("Body Mass (g)")

# plt.show()
maidr.show(b_plot)
```

## Heatmap

```{python}

# Load an example dataset from seaborn
glue = sns.load_dataset("glue").pivot(index="Model", columns="Task", values="Score")

# Plot a heatmap
plt.figure(figsize=(10, 8))
heatmap = sns.heatmap(glue, annot=True, fill_label="Score")
plt.title("Heatmap of Model Scores by Task")

# Show the plot
# plt.show()
maidr.show(heatmap)
```
  1. Render the qmd file and check the html result.
@SaaiVenkat
Copy link
Collaborator

#64 addresses this issue as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants