Closed jstrube closed 3 years ago
Yep, this is not supported. You might the first one to try it! I think we could add a recipe for that. I'll take a look.
great, thank you!
@jw3126, I think #43 will fix this issue but I would like to add an example similar to @jstrube's example, albeit with a bit prettier output. What about (edited the code)
using UnitfulRecipes, Plots, Unitful
using Unitful: GeV, MeV, c
x = (1.0:0.1:10) * GeV/c
y = @. (2 + sin(x / (GeV/c))) * 139.6MeV/c^2 # a sine to make it pretty
yerror = 10.9MeV/c^2 * exp.(randn(length(x))) # some noise for pretty again
plot(x, y; yerror, title="My unitful data with yerror bars", lab="")
which gives
Otherwise, @jstrube, maybe you have a more realistic example that we can use instead? Fee free to suggest anything! π
Edited the code example
I think the example looks fine. I just wouldn't call the variable piMassπ. Thanks for fixing that so quickly.
Added the example that you should now be able to see in https://jw3126.github.io/UnitfulRecipes.jl/previews/PR43/examples/1_Examples/#Error-bars-1
@jstrube give it a few minutes (hours) for the new version to be released and you should be able to pkg> up
and get going with the unitful errorbars!
great package! Unfortunately, I couldn't get this to work with a unitful yerr. I'm getting an error message of "incompatible units" if I try to put a unitful yerr on a unitful value. The error message actually reports the y value without units, and the yerr with units. For example:
gives me: