# When to use layoutable.attr = vs layoutable.attr\[\] =

**URL:** <https://discourse.julialang.org/t/when-to-use-layoutable-attr-vs-layoutable-attr/62405>\
**Category:** General Usage\
**Tags:** makie\
**Created:** [June 4, 2021, 8:46pm UTC](https://discourse.julialang.org/t/when-to-use-layoutable-attr-vs-layoutable-attr/62405 "2021-06-04T20:46:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [June 4, 2021, 8:46pm UTC](https://discourse.julialang.org/t/when-to-use-layoutable-attr-vs-layoutable-attr/62405/1 "2021-06-04T20:46:53Z")

</div>

```julia
using CairoMakie

f = Figure()

ax = Axis(f[1, 1])

markersizes = [5, 10, 15,]
colors = [:red, :green, :blue, :orange]

for ms in markersizes, color in colors
    scatter!(randn(5, 2), markersize = ms, color = color)
end

ax.xticklabelsize[] = 20

f

```

When do I want `layoutable.attr = _` vs `layoutable.attr[] = _`? In this case they seem to do the same thing, but maybe there are cases where they differ.

---

<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:** [June 5, 2021, 6:26am UTC](https://discourse.julialang.org/t/when-to-use-layoutable-attr-vs-layoutable-attr/62405/2 "2021-06-05T06:26:36Z")

</div>

The first one is especially overloaded setproperty! syntax to make it easy to change attributes, in the second one you first getproperty the observable and then mutate it with like usual. They’re functionally equivalent.
