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

CairoMakie: Marker Rotation is not exported (scatter) #1465

Closed
behinger opened this issue Nov 19, 2021 · 5 comments
Closed

CairoMakie: Marker Rotation is not exported (scatter) #1465

behinger opened this issue Nov 19, 2021 · 5 comments

Comments

@behinger
Copy link
Contributor

Minimal example

using CairoMakie
xtimes = 10
x = repeat([1],xtimes)
y = range(0,5,length=xtimes) |> collect
rot = range(0,stop=π*2,length=xtimes) |> collect
fg = scatter(x,y,rotation=rot,marker='')
save("bug.pdf",fg)

With GLMakie
grafik

With CairoMakie
grafik

Clearly CairoMakie should have rotated the arrows as well

In earlier versions of CairoMakie glyphs drawn with annotations did work with rotations, but havent tested it yet.

PS: The different markersizes are surely reported somewhere (?), a bit annoying to work with...
PPS: Great work as always!

@jkrumbiegel
Copy link
Member

jkrumbiegel commented Nov 19, 2021

Hm weird, CairoMakie needs a rotations keyword it seems. I don't know why that's different for GLMakie?
And you're right about the glyph size difference, although I'd argue that CairoMakie is correct there because the default markersize is only 9 and this glyph just looks quite small at that size, for comparison the axis labels etc. are size 16. Also, I had implemented it once in CairoMakie like I felt it was correct, that glyph markers are not scaled to squares by default but keep their original glyph aspect ratio. You can see that GLMakie does the scaling thing as the arrows are squished. We need to decide on one behavior and stick with it.

set_theme!()
xtimes = 10
x = repeat([1],xtimes)
y = range(0,5,length=xtimes) |> collect
rot = range(0,stop=π*2,length=xtimes) |> collect
fg = scatter(x,y,rotations=rot,marker='')

grafik

@behinger
Copy link
Contributor Author

so GLMakie accepts both rotations & rotation but CairoMakie only rotations correct?

From a user perspective it happened multiple times that I misspell something, but get no error, and then wonder why something doesnt work - I understand that parsing this is hard because one doesnt exactly know what all the possible targets are - you are probably aware of it.

The changing the glyph-size automatically in GLMakie always confused me, I see a plot more like a painting ;) But I agree, consistency would be nice here

@jkrumbiegel
Copy link
Member

Well GLMakie uses quads to draw glyphs on, and these quads are by default all the same size. To get an unsquare quad and thereby correct glyph aspect ratio, one would have to take the additional step of querying glyph size, which I've always found quite undesirable for end users. So CairoMakie does that automatically, I've kind of treated GLMakie behavior like a bug in that way, which might have been a bit drastic.

Unknown keywords should error in future refactors of plot types, right now attribute collections are just dumb dictionaries, you can put anything in them as long as noone asks

@Larbino1
Copy link

so GLMakie accepts both rotations & rotation but CairoMakie only rotations correct?

This seems to still be an issue on CairoMakie v0.10.7
I found this thread straight away upon googling, so not a big problem, but thought would bump the issue anyway!

@ffreyer
Copy link
Collaborator

ffreyer commented May 24, 2024

Fixed in Makie 0.21 via #3724

@ffreyer ffreyer closed this as completed May 24, 2024
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

4 participants