Giter VIP home page Giter VIP logo

Comments (22)

joshday avatar joshday commented on May 17, 2024

👍 I started messing around with plotting methods for OnlineStats, so this would be great.

from plots.jl.

lobingera avatar lobingera commented on May 17, 2024

Better call it 'near-real-time' updating, or 'Update Data'. People would expect real-time plotting and for e.g. a PDF output that's hard to do...

from plots.jl.

tbreloff avatar tbreloff commented on May 17, 2024

@joshday Cool... are you working on the "josh" branch? I have some ideas there... maybe we should start an issue to discuss at OnlineStats?

@lobingera I hear ya... certainly the degree of "real-time-ness" depends on the backend. Likely UnicodePlots and Gadfly aren't good for this, but any of the others could be?

from plots.jl.

lobingera avatar lobingera commented on May 17, 2024

But it like this: real-time-update sounds like you connect some data with some graph and if the data is updated, the graph follows. Actually earlier (some months ago) i asked if the REPL can support this -> filter, what has been changed (LHS of evaluation,assignment) and feed that information somewhere. Back then the REPL wasn't able, but maybe now. In any case you need some infrastructure to get that change down. How about auto-scaling in cases like this?

from plots.jl.

tbreloff avatar tbreloff commented on May 17, 2024

real-time-update sounds like you connect some data with some graph and if the data is updated, the graph follows

This is exactly what I want to do, and the prototype can already work this way. You can just call gui() to update the display between each push!.

This currently works as expected (on master)... one extra point is added to the graph every half-second:

using Plots; immerse!()
plt = plot([0,0.1], Any[rand(2),sin])
for x in 0.2:0.1:π
    push!(plt, 1, x, rand())
    push!(plt, 2, x, sin(x))
    gui(); sleep(0.5)
end

from plots.jl.

lobingera avatar lobingera commented on May 17, 2024

as a side question: why immerse!() ? I thought, ! methods are supposed to change the argument, and there's little argument

from plots.jl.

tbreloff avatar tbreloff commented on May 17, 2024

@lobingera My interpretation of ! methods is that they are appropriate whenever you are changing state (whether or not that state belongs to the arguments). For this particular case, I agree that the ! probably isn't necessary, and I could add immerse() to do the same thing.

from plots.jl.

tbreloff avatar tbreloff commented on May 17, 2024

Also technically speaking the plot!(rand(10)) calls fall into this category as well. You're changing the state of a Plot object, but it's not an argument to the method, it just happens to change the state of the return value from currentPlot().

from plots.jl.

lobingera avatar lobingera commented on May 17, 2024

Statefull vs. stateless plot commands is a tricky thing. Statefull makes great sense in REPL, but not necessarily in scripted plotting. And maybe this discussion should be in #1

from plots.jl.

tbreloff avatar tbreloff commented on May 17, 2024

I don't think I understand your point. Why is REPL any different than scripting here?

from plots.jl.

tbreloff avatar tbreloff commented on May 17, 2024

In regards to the real-time-ness discussion, I ran a quick test... 17 millis per update may not be "real-time" but it's certainly close enough for most applications (and certainly better than re-writing a PDF every time). However, in most cases you wouldn't update the display after every data point unless the points were updating very slowly.

tmp

from plots.jl.

lobingera avatar lobingera commented on May 17, 2024

@tbreloff
In the REPL you work with a single scope, so the state will be atomic. When you run a script in a single instance you will use a single state, but what if you try to parallelize?

from plots.jl.

tbreloff avatar tbreloff commented on May 17, 2024

You can always call plot!(plt, args...; kw...) and control which object's state is changed...

On Sep 24, 2015, at 5:04 PM, Andreas Lobinger [email protected] wrote:

@tbreloff
In the REPL you work with a single scope, so the state will be atomic. When you run a script in a single instance you will use a single state, but what if you try to parallelize?


Reply to this email directly or view it on GitHub.

from plots.jl.

tbreloff avatar tbreloff commented on May 17, 2024

I have pretty good support for updating plots now, so closing this.

from plots.jl.

zsoerenm avatar zsoerenm commented on May 17, 2024

Is there a way to push errorbars or ribbons?
Something like this?

push!(plt, 3, 1, err = 2)
push!(plt, 3, 1, ribbon = 2)

If not is there a workaround?
At the moment I get the following error:

ERROR: function push! does not accept keyword arguments

from plots.jl.

mkborregaard avatar mkborregaard commented on May 17, 2024

plot!?

from plots.jl.

zsoerenm avatar zsoerenm commented on May 17, 2024

Well, I think plot! does only add a new line to the current plot, doesn't it?
Whereas, I want to extend a current errorbar / ribbon at the end with a new value.

from plots.jl.

mkborregaard avatar mkborregaard commented on May 17, 2024

If you give an MWE I wouldn't mind commenting on what you're doing. But push! isn't defined for Plot objects.

from plots.jl.

zsoerenm avatar zsoerenm commented on May 17, 2024

Here you go:

using Plots
plt = plot(1:10, zeros(10), err = randn(10))
push!(plt, 1, 11, 0.1)

figure_1

This extends the line without the errorbar by a new value.
Is there a way to do the same for the errorbars?

from plots.jl.

mkborregaard avatar mkborregaard commented on May 17, 2024

Ha, I didn't realize you could do that :-) I just looked at the code, and no, it doesn't seem like you can do that, sry.

from plots.jl.

zsoerenm avatar zsoerenm commented on May 17, 2024

I think I found a workaround using plot!

using Plots

plt = plot(1:10, zeros(10), err = randn(10))
plot!(plt, 11:11, 0.1:0.1, err = 0.5, legend=false)
push!(plt, 1, 11, 0.1)

figure_1
Thanks for taking your time

from plots.jl.

adhal007 avatar adhal007 commented on May 17, 2024

I have a plot for each of a 100 samples run for 1000 iterations, so it creates an array of 100 plots. How is it possible to merge these into one plot ?

Thank you for your inputs

from plots.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.