Giter Club home page Giter Club logo

Comments (7)

stevengj avatar stevengj commented on June 19, 2024

cc: @one-more-minute; I haven't tried LT yet, so I don't have any experience with this.

PyPlot attempts to do inline plotting whenever displayable returns true for image/png or other supported image formats. In that case, it calls redisplay(fig) from each plotting command.

LightTable's Display subclass should probably overload redisplay(d, x) to add x to a queue of things to display (removing duplicates), and then flush the queue at the end of an input execution, similar to IJulia. See inline.jl, and the undisplay function (which is also called on the result of an input evaluation to avoid displaying the result twice).

from pyplot.jl.

berceanu avatar berceanu commented on June 19, 2024

Ok, but for starters I would settle for a separate plotting window being opened. This however does not happen.

from pyplot.jl.

stevengj avatar stevengj commented on June 19, 2024

That's because PyPlot thinks that inline display is available. You can run pygui(true) to explicitly force a separate Python plotting window even if there is an inline display.

from pyplot.jl.

stevengj avatar stevengj commented on June 19, 2024

Looks like there was a bug in redisplay(x) that may have prevented it from working properly here.

from pyplot.jl.

MikeInnes avatar MikeInnes commented on June 19, 2024

Thanks for letting me know, I'll take a look at this.

from pyplot.jl.

jamesdanged avatar jamesdanged commented on June 19, 2024

This works now. Just call PyPlot's "figure()" method to see results inline.

import PyPlot
pplt = PyPlot

x = [x/1000 * 2_pi for x=1:1000]
y = sin(3_x + 4_cos(2_x))
pplt.plot(x, y, color="red", linewidth=2.0, linestyle="--")
pplt.title("Sample graph")
pplt.figure(1)

from pyplot.jl.

stevengj avatar stevengj commented on June 19, 2024

figure shouldn't be necessary if redisplay is implemented as I explained above.

from pyplot.jl.

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.