Giter Club home page Giter Club logo

Comments (5)

proItheus avatar proItheus commented on May 13, 2024 1

Well, I realized I have enabled privacy.resistFingerprinting in firefox. When this switch is turned off, it works fine.

from marimo.

akshayka avatar akshayka commented on May 13, 2024

Hey, thanks for opening.

Each cell gets its own figure for the imperative API. So in your last cell, plt.gcf() returns an empty figure. We can add this to the documentation.

  • You could combine the plotting cell and the cell that uses mpl.interactive.
  • Or you could use the object oriented API and grab the axis object.

Let me know if they look ok to you.

Two options below.

import marimo

__generated_with = "0.1.36"
app = marimo.App()


@app.cell
def __():
    import marimo as mo
    import numpy as np
    from matplotlib import pyplot as plt
    return mo, np, plt


@app.cell
def __(np):
    x=np.linspace(0,1,20)
    return x,


@app.cell
def __(mo, plt, x):
    plt.plot(x,x)
    mo.mpl.interactive(plt.gcf())
    return


if __name__ == "__main__":
    app.run()

This should also work:

import marimo

__generated_with = "0.1.36"
app = marimo.App()


@app.cell
def __():
    import marimo as mo
    import numpy as np
    from matplotlib import pyplot as plt
    return mo, np, plt


@app.cell
def __(np):
    x=np.linspace(0,1,20)
    return x,


@app.cell
def __(plt, x):
    plt.plot(x, x)
    ax = plt.gca()
    return ax,


@app.cell
def __(ax, mo):
    mo.mpl.interactive(ax)
    return


if __name__ == "__main__":
    app.run()

from marimo.

proItheus avatar proItheus commented on May 13, 2024

Well, not exactly. It is no longer blank, but still have some weird behavior.
plot.webm

from marimo.

akshayka avatar akshayka commented on May 13, 2024

Oh weird. @mscolnick could this have to do with iframe resizing?

from marimo.

mscolnick avatar mscolnick commented on May 13, 2024

@proItheus, i am unable to reproduce it. on my computer the interactive plot takes up the full size it is given.

couple questions that could help us:

  • what browser are you using
  • what version of matplotlib

thanks

from marimo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.