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

add alpha aesthetic to Geom.line #1603

Merged
merged 1 commit into from
Dec 31, 2022

Conversation

bjarthur
Copy link
Member

@bjarthur bjarthur commented Dec 11, 2022

fixes #1589

julia> using Gadfly, DataFrames

julia> test = DataFrame(
           x=1:100,
           y=rand(100),
           z = repeat(["a", "b"], outer = 50));

julia> plot(test,
            x=:x,
            y=:y,
            color = :z,
            Geom.line,
            alpha=[0.1])

julia> plot(test,
            x=:x,
            y=:y,
            alpha = :z,
            Geom.line,
            Theme(alphas=[1.0,0.5]))

Screen Shot 2022-12-11 at 10 59 25 AM

Screen Shot 2022-12-11 at 10 59 32 AM

@codecov-commenter
Copy link

codecov-commenter commented Dec 11, 2022

Codecov Report

Merging #1603 (e405027) into master (89ca326) will decrease coverage by 0.57%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1603      +/-   ##
==========================================
- Coverage   89.15%   88.57%   -0.58%     
==========================================
  Files          39       39              
  Lines        4942     4954      +12     
==========================================
- Hits         4406     4388      -18     
- Misses        536      566      +30     
Impacted Files Coverage Δ
src/geom/line.jl 100.00% <100.00%> (ø)
src/scale.jl 86.57% <0.00%> (-4.84%) ⬇️
src/geom/rectbin.jl 80.00% <0.00%> (-2.23%) ⬇️
src/guide.jl 90.13% <0.00%> (-1.05%) ⬇️
src/coord.jl 89.07% <0.00%> (-0.85%) ⬇️
src/mapping.jl 85.24% <0.00%> (-0.82%) ⬇️
src/geom/subplot.jl 93.92% <0.00%> (-0.56%) ⬇️
src/aesthetics.jl 80.64% <0.00%> (-0.53%) ⬇️
src/Gadfly.jl 76.75% <0.00%> (-0.38%) ⬇️
src/statistics.jl 94.26% <0.00%> (-0.28%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Mattriks
Copy link
Member

Mattriks commented Dec 12, 2022

I'm surprised that this PR works (GiovineItalia/Compose.jl#386 (comment)), but nice that it does. I will try to think of some examples that it might fail for (due to Compose), but I think this PR is ok as is (we can fix any issues in Compose later).

@bjarthur
Copy link
Member Author

i just added a test. SVG, PDF, and PNG output all work for me. @Mattriks let me know if you find a case if fails.

@bjarthur bjarthur merged commit 65100cd into GiovineItalia:master Dec 31, 2022
@bjarthur bjarthur deleted the bja/linealpha branch December 31, 2022 18:18
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

Successfully merging this pull request may close these issues.

Alpha for Geom.line and Geom.path
3 participants