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

marker size different between backends #4830

Open
3 tasks done
aplavin opened this issue Feb 27, 2025 · 3 comments · May be fixed by #4832
Open
3 tasks done

marker size different between backends #4830

aplavin opened this issue Feb 27, 2025 · 3 comments · May be fixed by #4832
Labels
bug GLMakie This relates to GLMakie.jl, the OpenGL backend for Makie. WGLMakie This relates to WGLMakie.jl, the Web-based WebGL backend for Makie.

Comments

@aplavin
Copy link
Contributor

aplavin commented Feb 27, 2025

The same code results in very different marker sizes with Cairo and with GL:

scatter((0,0), marker=:circle, markersize=30, label="A")
scatter!((1,0), marker='', markersize=80, label="B")
scatter!((0,1), marker='', markersize=45, label="C")
axislegend()

save("tmp_gl.png", current_figure(), backend=GLMakie)
save("tmp_cairo.png", current_figure(), backend=CairoMakie)

Cairo:
Image
GL:
Image

  • what version of Makie are you running? (]st -m Makie) v0.22
  • can you reproduce the bug with a fresh environment ? (]activate --temp; add Makie)
  • What platform + GPU are you on? any
@asinghvi17
Copy link
Member

asinghvi17 commented Feb 27, 2025

Hmm, so on GL these get converted to signed distance fields if I recall correctly, in Cairo they are just text. We probably need to interrogate the glyph bounding box and rescale the glyph to fit the markersize in Cairo....

@asinghvi17 asinghvi17 added the CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo. label Feb 27, 2025
@jkrumbiegel
Copy link
Member

I'm pretty sure these were consistent at some point, maybe a regression?

@ffreyer
Copy link
Collaborator

ffreyer commented Feb 27, 2025

I think the issue here is with how GLMakie scales character markers. If you compare with text CairoMakie matches up nicely, GLMakie does not.

f,a,p = scatter((0,1), marker=Rect, markersize=45, color = :black, strokecolor = :red, strokewidth = 1)
scatter!((0,1), marker='', markersize=45, color = :white)

scatter!((1, 1), marker=Rect, markersize=45, color = :green, strokecolor = :red, strokewidth = 1)
text!((1, 1), text = "", fontsize = 45, align = (:center, :center), color = :white)

xlims!(a, -1, 2)
f
CairoMakie GLMakie
Image Image

@ffreyer ffreyer added GLMakie This relates to GLMakie.jl, the OpenGL backend for Makie. WGLMakie This relates to WGLMakie.jl, the Web-based WebGL backend for Makie. and removed CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo. labels Feb 27, 2025
@ffreyer ffreyer linked a pull request Feb 27, 2025 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug GLMakie This relates to GLMakie.jl, the OpenGL backend for Makie. WGLMakie This relates to WGLMakie.jl, the Web-based WebGL backend for Makie.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants