在帖子中放置一个实时的 Matplotlib 图形需要做些什么?

哦!我完全误解了 HTML 的生成方式。如果用户预先生成 HTML,您可以让他们从外部站点 iframe,并将该域列入白名单。

例如,codepen,默认情况下应该允许:

<iframe height="300" width="800" style="width: 100%;" scrolling="no" title="mplD3 example, actually working" src="https://codepen.io/gully/embed/BawMGr?default-tab=result" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true">
  See the Pen <a href="https://codepen.io/gully/pen/BawMGr">
  mplD3 example, actually working</a> by gully (<a href="https://codepen.io/gully">@gully</a>)
  on <a href="https://codepen.io">CodePen</a>.
</iframe>
3 个赞