Code Monkey home page Code Monkey logo

Comments (6)

geyang avatar geyang commented on June 29, 2024

it looks like No.4 will be difficult without updating plot.ly library.

from visdom.

ajabri avatar ajabri commented on June 29, 2024

It's becoming increasingly clear that it might be worth it to assemble some utility functions. E.g, for the continuous error bars, something along the lines of:

def make_errors(ys,xs=None, color=None, name=None):
    if xs is None:
        xs = [list(range(len(y))) for y in ys]

    minX = min([len(x) for x in xs])

    xs = [x[:minX] for x in xs]
    ys = [y[:minX] for y in ys]

    assert all([(len(y) == len(ys[0])) for y in ys]), \
        'Y should be the same size for all traces'

    assert all([(x == xs[0]) for x in xs]), \
        'X should be the same for all traces'

    y = np.array(ys)
    yavg = np.mean(y, 0)
    ystd = np.std(y, 0)

    err_traces = [
        dict(x=xs[0], y=yavg.tolist(), mode='lines', name=name,
            line=dict(color=color)),
        dict(
            x=xs[0] + xs[0][::-1],
            y=(yavg + ystd).tolist() + (yavg - ystd).tolist()[::-1],
            fill='tozerox',
            fillcolor=(color[:-1] + str(', 0.2)')).replace('rgb', 'rgba')
                        if color is not None else None,
            line=dict(color='transparent'),
            name=name + str('_error') if name is not None else None,
        )
    ]

    return err_traces, xs, ys

from visdom.

dizcza avatar dizcza commented on June 29, 2024

@ajabri, how to send these traces in Visdom?
I image something like viz._send(err_traces, ...?)

from visdom.

Spandan-Madan avatar Spandan-Madan commented on June 29, 2024

Does the closed issue mean that these have been incorporated? Or that accepting it as an "enhancement" is enough to close the issue?

I would like the smooth interpolated curve functionality quite a lot.

from visdom.

JackUrb avatar JackUrb commented on June 29, 2024

Some of these are still definitely on the radar, but I've been caught up in larger infrastructural issues that I'm working still working through before I can get back to enhancements.

If you want to contribute to smoothing, I'd be happy to accept a PR that adds a numeric "smoothing" argument to the React component in PlotPane that handles parsing through the data and averaging points with the number of neighbors listed in "smoothing". Then I can extract widgets out of #393 and get things working even without me finishing blockers for #393.

from visdom.

rmehta1987 avatar rmehta1987 commented on June 29, 2024

@dizcza if you still need to know, to send traces to plotly you need to do:

viz._send({'data': err_traces, 'layout': layout, 'win': 'mywin'})

also you need to include the type of plot so, the dicts should should be:

dict(x=xs[0], y=yavg.tolist(), mode='lines', type='line', name=name,
            line=dict(color=color))

from visdom.

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.