Skip to content
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

Order dependent incorrect handling of NaN in Geom.ribbon #1167

Closed
tlnagy opened this issue Jun 20, 2018 · 0 comments · Fixed by #1231
Closed

Order dependent incorrect handling of NaN in Geom.ribbon #1167

tlnagy opened this issue Jun 20, 2018 · 0 comments · Fixed by #1231
Labels

Comments

@tlnagy
Copy link
Member

tlnagy commented Jun 20, 2018

Ran into a bug with Geom.ribbon where if ymin/ymax are first NaN then concrete values, the concrete values are ignored. However, if the concrete values appear first then it works correctly.

using Gadfly
srand(123);
ys = rand(20)
plot(x=repeat(1:10, outer=2), y=ys, ymin=ys.-1, ymax=ys.+1, color=repeat([:a,:b], inner=10), Geom.line, Geom.ribbon)

image

Concrete values first

ys2 = copy(ys)
ys2[11:end] = NaN
plot(x=repeat(1:10, outer=2), y=ys2, ymin=ys2.-1, ymax=ys2.+1, color=repeat([:a,:b], inner=10), Geom.line, Geom.ribbon)

image

NaN values first

The expect behavior here is Geom.ribbon showing the yellow values

ys2 = copy(ys)
ys2[1:10] = NaN
plot(x=repeat(1:10, outer=2), y=ys2, ymin=ys2.-1, ymax=ys2.+1, color=repeat([:a,:b], inner=10), Geom.line, Geom.ribbon)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant