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

band plot gives artifact #269

Closed
tbenst opened this issue Aug 24, 2021 · 2 comments
Closed

band plot gives artifact #269

tbenst opened this issue Aug 24, 2021 · 2 comments

Comments

@tbenst
Copy link

tbenst commented Aug 24, 2021

Xs = repeat(collect(1:100), 10)
Ys = sin.(Xs) + randn(1000)*0.2
df = DataFrame(x=Xs, y=Ys)
df = transform(groupby(df, ["x"]),
    "y" => mean, "y" => minimum, "y" => maximum)
data(df) * mapping(:x, :y_minimum, :y_maximum) * visual(Band) |> draw

image

@jkrumbiegel
Copy link
Member

This is in the nature of the data you prepared, your x values loop back to 1 after reaching 100. If you sort or filter the data, the problem goes away.

@tbenst
Copy link
Author

tbenst commented Sep 2, 2024

oh! transform didn't do what i expected. this works :)

using AlgebraOfGraphics, DataFrames, StatsBase, CairoMakie
Xs = repeat(collect(1:100), 10)
Ys = sin.(Xs) + randn(1000)*0.2
df = DataFrame(x=Xs, y=Ys)
df = transform(groupby(df, ["x"]),
    "y" => mean, "y" => minimum, "y" => maximum)[1:100,:]
data(df) * mapping(:x, :y_minimum, :y_maximum) * visual(Band) |> draw
image

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

No branches or pull requests

2 participants