-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FR] Plot recipe: ribbon plots option beside error bars #109
Comments
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:
If you can provide answers to these questions, I'd very much appreciate a pull request |
I agree, it's better for a function.
Yeah me too, I can't think of a name.
Yes, it does! I did test this one out. It adds
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! |
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) |
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. |
My apologies, I never followed through on this. I'll action it next chance I get. |
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? |
@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
) The defaults are inherited from plot(x, y, uncertainty_plot = :ribbon) Edit: Noticed the double pi in my definitions haha. |
Yes, please, open a PR! |
@giordano how do I get permission to push to |
Looks good @kapple19 ! Did you make a fork? To open a pull request usually you have to fork the repository first. |
Ah, thanks heaps! I didn't know I had to fork it. Edit: I should add some unit tests actually. |
I'm happy to submit a pull request on this, I just want to confirm that the package devs are happy with this suggestion: add a ribbon option for the plot output. Motivation: Plots.jl and Measurements.jl don't have a simple "switch" to flick to use the readily-available info in a
Measurement
instance of the±
information.I'm not sure if I would (1) add a new recipe to plot-recipes.jl or (2) alter an existing recipe.
The recipe I could alter would be something like
Please advise, this would be my first ever pull request, and I'm still learning about Plots.jl recipes. Thanks for the great package!
The text was updated successfully, but these errors were encountered: