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

show() to an IOBuffer with marker_space = :data results in an empty PDF #4609

Open
bjarthur opened this issue Nov 21, 2024 · 2 comments
Open
Labels

Comments

@bjarthur
Copy link
Contributor

following this discussion on how to save a figure to an IOBuffer, i have found that setting markerspace to :data results in the marks being absent from the resulting PDF. with markerspace unspecified, everything works.

MWE:

using WGLMakie, CairoMakie, Base64, Bonito 

app = App() do
    f = Figure()   
    a, s = scatter(f[1,1], Point3f.(rand(10), rand(10), rand(10)),
                   markersize = 0.03, markerspace = :data     # delete this line and it will work
                   )

    CairoMakie.activate!() 
    io = IOBuffer()
    show(io, MIME"application/pdf"(), f)
    
    io2 = IOBuffer()
    print(io2, "data:application/pdf;base64,")
    print(io2, base64encode(take!(io)))

    DOM.div(f,
            "Click to download ",
            DOM.a("scatter.pdf",
                  href=String(take!(io2)),
                  download="scatter.pdf"))
end 

screenshot of GUI:
Image

screenshot of PDF:
Image

the latest version(s) of Makie freshly installed into a temporary environment on an apple M2 max:

(jl_Us6BFN) pkg> st
Status `/private/var/folders/s5/8d629n5d7nsf37f60_91wzr40000gq/T/jl_Us6BFN/Project.toml`
  [824d6782] Bonito v4.0.0
  [13f3f980] CairoMakie v0.12.16
  [276b4fcb] WGLMakie v0.10.16
  [2a0f44e3] Base64 v1.11.0
@bjarthur bjarthur added the bug label Nov 21, 2024
@jkrumbiegel
Copy link
Member

And a pdf via save doesn't have this problem? The title of the issue suggests that

@bjarthur
Copy link
Contributor Author

correct, save works fine.

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

No branches or pull requests

2 participants