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

Apparent error in docs on "transparency" #4388

Open
benedict-96 opened this issue Sep 20, 2024 · 2 comments
Open

Apparent error in docs on "transparency" #4388

benedict-96 opened this issue Sep 20, 2024 · 2 comments
Labels

Comments

@benedict-96
Copy link

In the docs "Problems with transparency" are described (https://docs.makie.org/stable/explanations/transparency#Problems-with-transparency).

I do obtain the same plot as is shown (overlap of red and blue planes) with GLMakie, but not with CairoMakie. The CairoMakie plot looks like this:
cairo_makie
Which is very different from what is shown in the docs.

The error seems to be that the default in the docs has switched from CairoMakie to GLMakie at some point as the corresponding part in the markdown file does not specify CairoMakie as backend in the first case:

```@figure
fig = Figure()
ax = LScene(fig[1, 1], show_axis=false)
p1 = mesh!(ax, Rect2f(-1.5, -1, 3, 3), color = (:red, 0.5), shading = NoShading)
p2 = mesh!(ax, Rect2f(-1.5, -2, 3, 3), color = (:blue, 0.5), shading = NoShading)
rotate!(p1, Vec3f(0, 1, 0), 0.1)
rotate!(p2, Vec3f(0, 1, 0), -0.1)
fig
```
```@figure backend=GLMakie
fig = Figure()
ax = LScene(fig[1, 1], show_axis=false)
p1 = mesh!(ax, Rect2f(-1.5, -1, 3, 3), color = (:red, 0.5), shading = NoShading)
p2 = mesh!(ax, Rect2f(-1.5, -2, 3, 3), color = (:blue, 0.5), shading = NoShading)
rotate!(p1, Vec3f(0, 1, 0), 0.1)
rotate!(p2, Vec3f(0, 1, 0), -0.1)
fig
```

@jkrumbiegel
Copy link
Member

Hm I would have thought the activate! gets spliced in by the code that handles the @figure blocks, but it seems not to have happened there.

(is_continued ? "" : """
using $backend
$backend.activate!(; px_per_unit = 2) # hide
""") *

@jkrumbiegel
Copy link
Member

Aha no the two images are actually the same image, the one from the GLMakie example. The CairoMakie image has been overwritten due to a bug here

id = string(hash(el.code), base = 16)[1:7]
el.code = transform_figure_code(el.code; id, page = page.source, pagetitle = title, is_continued, kwargs...)

it didn't take the hash together with the using CairoMakie part, so both blocks have exactly the same file name.

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