-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
add errorline.jl #513
add errorline.jl #513
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution. I got some stylistic and functional remarks.
Additionally we should think about whether this recipe needs to live here or could also be added to Plots.jl
itself.
Currently, I don't see a reason why not.
Co-authored-by: Simon Christ <SimonChrist@gmx.de>
Co-authored-by: Simon Christ <SimonChrist@gmx.de>
Co-authored-by: Simon Christ <SimonChrist@gmx.de>
…ed :raw error mode
I believe I've addressed all the changes. The error you got was because NaNMath only accepts Floats so I've added a conversion check. I also added the final distribution mode. I added a new runtest too with Ints as the y values for future checks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far this looks fine to me, there should be at least one example in the README as Documentation. Would be good to have another pair of eyes here.
I'll add an example or two to the readme in an hour or so
…On Tue, Aug 23, 2022, 7:17 AM Simon Christ ***@***.***> wrote:
***@***.**** approved this pull request.
So far this looks fine to me, there should be at least one example in the
README as Documentation. Would be good to have another pari of eyes here.
—
Reply to this email directly, view it on GitHub
<#513 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF6PLUSKKXDEWKY43SF6VI3V2S6L5ANCNFSM57IEPJGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a StatsPlots
user so I'm only going to add stylistic comments here. Otherwise, I don't see why it cannot go in, since this PR is tested and documented.
src/errorline.jl
Outdated
if centertype == :mean | ||
y_central = mapslices(NaNMath.mean, y, dims=2) | ||
elseif centertype == :median | ||
y_central = mapslices(NaNMath.median, y, dims=2) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if centertype == :mean | |
y_central = mapslices(NaNMath.mean, y, dims=2) | |
elseif centertype == :median | |
y_central = mapslices(NaNMath.median, y, dims=2) | |
end | |
y_central = if centertype == :mean | |
mapslices(NaNMath.mean, y, dims=2) | |
elseif centertype == :median | |
mapslices(NaNMath.median, y, dims=2) | |
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love that line 60 is a single line, I think it makes it awkward to read, but if broken into two lines I think that's pretty good so I'll do that unless that's against convention?
num_obs = size(y,2) | ||
if num_obs > numsecondarylines | ||
sub_sample_idx = sample(1:num_obs, numsecondarylines, replace=false) | ||
y_sub_sample = y[:,sub_sample_idx,g] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what convention is used in StatsPlots
(maybe we need an autoformatter here as well), but I find y[:, sub_sample_idx, g]
more readable.
Co-authored-by: t-bltg <tf.bltg@gmail.com>
Co-authored-by: t-bltg <tf.bltg@gmail.com>
Co-authored-by: t-bltg <tf.bltg@gmail.com>
Co-authored-by: t-bltg <tf.bltg@gmail.com>
Co-authored-by: t-bltg <tf.bltg@gmail.com>
Co-authored-by: t-bltg <tf.bltg@gmail.com>
…mentations of changes from review
… and bugfix for diff(extrema())
Function for parsing inputs to easily make a ribbons (https://ggplot2.tidyverse.org/reference/geom_ribbon.html) or errorbar https://www.mathworks.com/help/matlab/ref/errorbar.html) plot while allowing for easily controlling error type and also handles NaNs.