# Inset axis with non-transparent background

**URL:** <https://discourse.julialang.org/t/inset-axis-with-non-transparent-background/86763>\
**Category:** Visualization\
**Tags:** plotting, makie\
**Created:** [September 4, 2022, 3:56pm UTC](https://discourse.julialang.org/t/inset-axis-with-non-transparent-background/86763 "2022-09-04T15:56:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yhchang96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yhchang96/32/36499_2.png) [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Post date:** [September 4, 2022, 3:56pm UTC](https://discourse.julialang.org/t/inset-axis-with-non-transparent-background/86763/1 "2022-09-04T15:56:12Z")

</div>

My question is essentially the same as [this](https://discourse.julialang.org/t/inset-axis-in-makie/70209) and [this](https://discourse.julialang.org/t/makie-inset-axes-and-their-drawing-order/60987): I want to add an inset axis to an existing (main) axis, but the inset axis looks transparent and I can see the grid lines of the main axis through the inset.

The answers of the two mentioned posts involve `inset_ax.elements`, but when I run the code it complains `ERROR: type Axis has no field elements`. I am using `CairoMakie v0.8.13` and `GLMakie v0.6.13` and both gives error. I would like to know whether `ax.elements` is something obsolete and if so what’s the up-to-date way of accessing `ax.elements` / making inset axis non-transparent.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [September 4, 2022, 8:39pm UTC](https://discourse.julialang.org/t/inset-axis-with-non-transparent-background/86763/2 "2022-09-04T20:39:46Z")

</div>

I think you can do `translate!(insetax.blockscene, 0, 0, some_positive_value)` now. The axis is not transparent, it’s just at the same z value as the other one.

---

<div class="post-metadata">

**Author:** ![yhchang96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yhchang96/32/36499_2.png) [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Post date:** [September 4, 2022, 9:03pm UTC](https://discourse.julialang.org/t/inset-axis-with-non-transparent-background/86763/4 "2022-09-04T21:03:59Z")

</div>

This doesn’t seem to work.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [September 4, 2022, 9:07pm UTC](https://discourse.julialang.org/t/inset-axis-with-non-transparent-background/86763/5 "2022-09-04T21:07:41Z")

</div>

Not with a high value like 500 or so?

---

<div class="post-metadata">

**Author:** ![yhchang96](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yhchang96/32/36499_2.png) [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Post date:** [September 4, 2022, 9:20pm UTC](https://discourse.julialang.org/t/inset-axis-with-non-transparent-background/86763/6 "2022-09-04T21:20:06Z")

</div>

I tried `translate!(ax_inset.blockscene, 0, 0, 1000)` and this does work. Thanks.
