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

String as marker #22

Closed
mschauer opened this issue Nov 20, 2017 · 11 comments
Closed

String as marker #22

mschauer opened this issue Nov 20, 2017 · 11 comments

Comments

@mschauer
Copy link
Contributor

It would be nice to use Strings as markers in scatter.
https://github.com/SimonDanisch/Makie.jl/blob/cef849737a6833c2b96987025c1b90bf4ec1da25/src/plotsbase/converts.jl#L324 also seems strange. Cheers

@SimonDanisch
Copy link
Member

It would be nice to use Strings as markers in scatter.

What would you expect that to do? Basically annotations?

to_spritemarker(b, marker::Vector{Char}) = String(marker)

That's an artifact from text rendering bein pretty much a scatter plot of chars.

@mschauer
Copy link
Contributor Author

What would you expect that to do? Basically annotations?

Yes

That's an artifact from text rendering bein pretty much a scatter plot of chars.

Ah, I see were the problem comes from.

@SimonDanisch
Copy link
Member

A nicer way of not converting the marker to a string, would be to allow Union{String, Vector{Char} in the actual rendering code in GLVisualize....

Annotations are pretty much implemented in GLVisualize, I just need to wrap the function and export it in Makie :)

@mschauer
Copy link
Contributor Author

Yes, allowing that in GLVisualize would be best. Still I think there is a bug here:
https://github.com/SimonDanisch/Makie.jl/blob/2386fb3b8b9784b649c6aca2e5c90f527b43e314/src/plotsbase/converts.jl#L344 gives problems. If you have e.g. a vector of Symbols, that gets converted into a vector of chars, which then is converted into a string in L344, which does not make sense.

@SimonDanisch
Copy link
Member

Why not? Symbols are just a stand in for unicode characters, and a bunch of unicode characters are represented as a string ;)

@mschauer
Copy link
Contributor Author

The issue in short:

 scatter(GeometryTypes.Point3f0[(1,0,0), (0,1,0), (0,0,1)], marker=[:x, :circle, :cross])
ERROR: MethodError: no method matching to_spritemarker(::Makie.Scene{:makie}, ::String)

@SimonDanisch
Copy link
Member

Ahhh, sorry, since you never mentioned that it actually errors, I was a bit slow to follow ;)

@mschauer
Copy link
Contributor Author

slow

That was mutual, it took me also to figure out that it actually should work.

@SimonDanisch
Copy link
Member

Oh, well no wonder why i didn't see the problem with it - the conversion code is correct, but I don't have the scatter code setup to actually deal with strings for multiple markers :D

@SimonDanisch
Copy link
Member

Okay this should be fixed on GLVisualize master and this branch: #24

@mschauer
Copy link
Contributor Author

Works!

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