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

update cat_aes_var! #1333

Merged
merged 1 commit into from
Nov 2, 2019
Merged

Conversation

Mattriks
Copy link
Member

  • I've run the regression tests
  • I've built the docs and confirmed these changes don't cause new errors

This PR:

cat_aes_var! is called by Gadfly.concat, which forms the plot_aes (later used in rendering guides). In Gadfly, all aesthetics are 1d vectors, not arrays (except for z).
With this PR, z arrays fallback on the general cat_aes_var! function.

Examples (from #1228):

p1 = plot( layer(x=[5], y=[1.0], shape=[Shape.star1]),
    layer(x=1:10, y=rand(10), Geom.point, shape=[Shape.circle], alpha=[0.1]),
    Theme(point_size=4pt, discrete_highlight_color=identity, key_position=:none) )

Zi = [(x,y) for x in -5:0.5:5, y in -5:0.5:5]
fn1(x) = x[1]*exp(-hypot(x[1]/3, x[2]/3)^2); fn2(x) = cos(hypot(x[1], x[2])/0.5)+1.0
i, ls = -5:0.5:5, 0.2:0.2:0.8
p2 = plot(Coord.cartesian(fixed=true),
    layer(z=fn2.(Zi), x=i, y=i, Geom.contour(levels=[1.0]), Theme(line_style=[:dash])),
    layer(z=fn1.(Zi), x=i, y=i, Stat.contour(levels=[-ls; ls]), Geom.polygon(fill=true)),
    Scale.color_continuous(minvalue=-1, maxvalue=1.0), Theme(lowlight_color=identity) 
)
hstack(p1, p2)

iss1228

@Mattriks Mattriks changed the title update cat_aes_var update cat_aes_var! Oct 24, 2019
@codecov-io
Copy link

codecov-io commented Oct 25, 2019

Codecov Report

Merging #1333 into master will increase coverage by 0.1%.
The diff coverage is 60%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #1333     +/-   ##
=========================================
+ Coverage   90.02%   90.12%   +0.1%     
=========================================
  Files          36       36             
  Lines        3941     3941             
=========================================
+ Hits         3548     3552      +4     
+ Misses        393      389      -4
Impacted Files Coverage Δ
src/aesthetics.jl 81.03% <60%> (+0.86%) ⬆️
src/statistics.jl 96.94% <0%> (+0.1%) ⬆️
src/geom/polygon.jl 100% <0%> (+5.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 56c0112...1192c93. Read the comment docs.

@bjarthur
Copy link
Member

LGTM. i'd squash the commits when merging. thanks!

@Mattriks
Copy link
Member Author

Done.

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.

Julia 1.0 incompatibility in cat_aes_var!()
3 participants