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

Guide.shapekey updates #1411

Merged
merged 2 commits into from
Apr 15, 2020
Merged

Conversation

Mattriks
Copy link
Member

@Mattriks Mattriks commented Apr 6, 2020

  • I've updated the documentation to reflect these changes
  • I've added and/or updated the unit tests
  • I've run the regression tests
  • I've built the docs and confirmed these changes don't cause new errors

This PR:

Example

x, y = 1:5, rand(5)
p1 = plot(x=x, y=y, shape=[Shape.square], size=[8pt])

p2 = plot(Theme(point_size=6pt, alphas=[0.6]),
    layer(x=0.5:4, y=rand(4), shape=["Gr1"]),
     layer(x=4*rand(4), y=rand(4), shape=["Gr2"]) )

p3 = plot(x=x, y=y, shape=x, size=[6pt], color=[colorant"orange"])
hstack(p1,p2,p3)

key_shape

@codecov-io
Copy link

codecov-io commented Apr 6, 2020

Codecov Report

Merging #1411 into master will decrease coverage by 0.72%.
The diff coverage is 92.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1411      +/-   ##
==========================================
- Coverage   90.31%   89.58%   -0.73%     
==========================================
  Files          39       39              
  Lines        4242     4291      +49     
==========================================
+ Hits         3831     3844      +13     
- Misses        411      447      +36     
Impacted Files Coverage Δ
src/guide/keys.jl 83.06% <84.61%> (-0.97%) ⬇️
src/misc.jl 65.06% <100.00%> (-2.46%) ⬇️
src/scale.jl 97.55% <100.00%> (+0.08%) ⬆️
src/theme.jl 65.07% <0.00%> (-4.42%) ⬇️
src/color_misc.jl 60.60% <0.00%> (-3.92%) ⬇️
src/Gadfly.jl 76.66% <0.00%> (-2.45%) ⬇️
src/aesthetics.jl 80.00% <0.00%> (-1.31%) ⬇️
src/bincount.jl 94.89% <0.00%> (-0.98%) ⬇️
src/data.jl 0.00% <0.00%> (ø)
... and 2 more

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 3a2e115...a96839e. Read the comment docs.

@Mattriks
Copy link
Member Author

Mattriks commented Apr 8, 2020

The regression tests showed the following changes. With this PR, in testscripts:

  1. "point_color_shape_size.jl", "point_shape_explicit.jl", and "shape_hvline.jl" the shapekey is not triggered (this is correct). Note that the examples in the first two testscripts are written in "old Gadfly style" (pre-shapekey) and could be updated in the future.

  2. "key_columns.jl" shows that the size aesthetic will override any default settings in Theme. This maybe an issue in a plot that uses multiple aesthetics (e.g. distinct size and shape mappings). Need to think more about plot p3 above (and if necessary add more to this PR).

@tlnagy
Copy link
Member

tlnagy commented Apr 8, 2020

This is great! I'm very excited for the propagation of a single color and shape through a layer. Makes multiple layer plots a lot easier. How hard would it be to autowrap non-array values? So you could do something like color=colorant"orange" instead of color=[colorant"orange"], which makes more sense from a user's perspective.

@Mattriks
Copy link
Member Author

Mattriks commented Apr 12, 2020

The syntax color=colorant"orange" needs investigation (not in this PR). Unfortunately for this PR, I've rollbacked the changes that made plot p3 possible, because a more elaborate design is really needed to make that work properly (e.g. for 2 layers with different keys). But this PR still closes #1366 (plot p1 and p2 above). I should regression test again.

@Mattriks
Copy link
Member Author

The regression tests now show changes to just the 3 testscripts listed in point 1 in my regression test post above. With this PR, in those 3 testscripts the shapekey doesn't trigger with shape=[Shape.function]. This is consistent with e.g.color=[colorant"color"] which doesn't trigger the colorkey.

This PR is now ready to merge.

src/misc.jl Show resolved Hide resolved
@bjarthur
Copy link
Member

is it worth putting this in the gallery?

@Mattriks
Copy link
Member Author

Mattriks commented Apr 13, 2020

Done. On Travis, for some reason the Codecov bit failed on Julia 1 just now.
Worked after reopening!

@Mattriks Mattriks closed this Apr 13, 2020
@Mattriks Mattriks reopened this Apr 13, 2020
@Mattriks
Copy link
Member Author

This is ready to merge.

@Mattriks Mattriks merged commit eb49440 into GiovineItalia:master Apr 15, 2020
@Mattriks Mattriks deleted the guide_shapekey branch April 17, 2020 23:52
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.

making scatter plots with different shaped markers (issues)
4 participants