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

How do I omit the Shapekey? #1233

Closed
Shushman opened this issue Jan 1, 2019 · 5 comments
Closed

How do I omit the Shapekey? #1233

Shushman opened this issue Jan 1, 2019 · 5 comments

Comments

@Shushman
Copy link

Shushman commented Jan 1, 2019

This is probably an obvious one but I am unable to completely omit Guide.shapekey. I tried Guide.shapekey(nothing) as an argument, like with Guide.xlabel(nothing), but I got unmatched argument errors. The closest I could get to was with Guide.shapekey(;title="", labels=[""], pos=Float64[]) but that seems messy and also still retains the symbols and numbers.

@Mattriks
Copy link
Member

Mattriks commented Jan 2, 2019

Please provide the code of your plot statement, e.g. are you using more than one key? Did you try Theme(key_position=:none)?

@Shushman
Copy link
Author

Shushman commented Jan 2, 2019

Oh that did it, thank you!

@Shushman Shushman closed this as completed Jan 2, 2019
@jonathanBieler
Copy link
Contributor

jonathanBieler commented Sep 2, 2019

I don't think that really solves the issue because if you want a ColorKey but no ShapeKey then key_position=:none hides both. Maybe a shape_key_position parameter is needed. A workaround I found is to move the ShapeKey out of the plot

plot(
    layer(x=rand(10), y=rand(10), shape=rand(0:1,10), Geom.point),
    layer(x=rand(10), y=rand(10), shape=rand(0:1,10), Theme(default_color=colorant"red"), Geom.point),
    Guide.manual_color_key("",["A","B"],["deepskyblue","red"]),
#    Guide.shapekey("",[""],[-10cm,-10cm]),
)

@tlnagy
Copy link
Member

tlnagy commented Sep 3, 2019

I think the key_position code was developed prior to the inclusion of shapekey so we likely need to break up that parameter to into two separate ones. Thoughts, @Mattriks?

@Mattriks
Copy link
Member

Mattriks commented Sep 3, 2019

There is also sizekey, alphakey and linekey tbd.
There are at least 2 potential ways to switch off multiple keys:

  1. Guides.guide(color=nothing, shape=nothing, line=nothing) (similar to ggplot's guides())
  2. layer(x= , y= , color= , Theme(key_position=:none))

Each way would be useful for different situations, so it would be good to implement both.

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

No branches or pull requests

4 participants