Code Monkey home page Code Monkey logo

Comments (11)

giordano avatar giordano commented on May 26, 2024 1

Hi, thanks for the interest! I agree that having the ability to choose between a ribbon and error bars would be cool, but I have two concerns:

  • does the ribbon make sense if you plot vectors? Or is it better to use it only for something smooth, like a function (plot(f, x))? Probably the distinction vectors vs function as input is moot, so maybe this concern is not too relevant, not sure
  • you suggest to add a keyword argument (I don't like err very much though, a bit cryptic and confusing), but how does that work in practice? Does it compose with other keyword arguments defined by other recipes? I never explored this possibility, I really don't know how this works

If you can provide answers to these questions, I'd very much appreciate a pull request

from measurements.jl.

kapple19 avatar kapple19 commented on May 26, 2024 1

does the ribbon make sense if you plot vectors? Or is it better to use it only for something smooth, like a function (plot(f, x))? Probably the distinction vectors vs function as input is moot, so maybe this concern is not too relevant, not sure

I agree, it's better for a function.

I don't like err very much

Yeah me too, I can't think of a name.

Does it compose with other keyword arguments defined by other recipes?

Yes, it does! I did test this one out. It adds err (or whatever we might choose) to the optional arguments. I might test it a bit more to see how it behaves in different order, if it's better as a keyword argument, etc.

I'd very much appreciate a pull request

Okay cool. As I was writing this issue, I realised that I would need to do more experimenting and digging into the bigger picture of Measurements.jl and RecipesBase.jl to understand the best way to do this. I'll let you know once I've rigorously and thoroughly thought out some potential solution(s). Thanks @giordano!

from measurements.jl.

dfabianus avatar dfabianus commented on May 26, 2024 1

Hello! :) Is there something new to this? I would use this quite often for model simulations where ribbons are way more effective than error bars.

My workaround right now is something like this:

y1 = Measurements.value.(y_meas)
y1u = Measurements.uncertainty.(y_meas)
# creating the ribbon
p = plot(t, y1.-y1u, fillranges = y1.+y1u, fillalpha = 0.25, linewidth=0, label = "" , fillcolor = 1)
# plotting the mean value on top
p = plot!(t, y1, label = "model", color=1)

from measurements.jl.

giordano avatar giordano commented on May 26, 2024 1

Is there something new to this?

I already explained I don't know how to do this myself, if someone has a clear view of how to best implement this, they're welcome to submit a pull request. I don't think that has happened yet.

from measurements.jl.

kapple19 avatar kapple19 commented on May 26, 2024

Hello! :) Is there something new to this? I would use this quite often for model simulations where ribbons are way more effective than error bars.

My apologies, I never followed through on this. I'll action it next chance I get.

from measurements.jl.

kapple19 avatar kapple19 commented on May 26, 2024

I have some changes on a local branch in a local clone, but I don't have permission to push. @giordano how would you like me to submit a pull request?

from measurements.jl.

kapple19 avatar kapple19 commented on May 26, 2024

@dfabianus here's a preview =)

x = range(0, 2π, 301)
yval = cospi.(x)
yunc = (5 .+ 2sinpi.(5x))/10
y = measurement.(yval, yunc)
plot(x, y,
    uncertainty_plot = :ribbon,
    label = "model",
    fillalpha = 0.25,
    color = 1
)

dfabianus

The defaults are inherited from Plots.jl of course:

plot(x, y, uncertainty_plot = :ribbon)

dfabianus_newer

Edit: Noticed the double pi in my definitions haha.

from measurements.jl.

giordano avatar giordano commented on May 26, 2024

Yes, please, open a PR!

from measurements.jl.

kapple19 avatar kapple19 commented on May 26, 2024

@giordano how do I get permission to push to JuliaPhysics/Measurements.jl? I can't open a pull request because I don't have permission to publish and push my branch to this repository.

from measurements.jl.

dfabianus avatar dfabianus commented on May 26, 2024

Looks good @kapple19 ! Did you make a fork? To open a pull request usually you have to fork the repository first.
Have a look here:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork

from measurements.jl.

kapple19 avatar kapple19 commented on May 26, 2024

Ah, thanks heaps! I didn't know I had to fork it.

Edit: I should add some unit tests actually.

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