# Disable legend in AlgebraOfGraphics

**URL:** <https://discourse.julialang.org/t/disable-legend-in-algebraofgraphics/77906>\
**Category:** Visualization\
**Tags:** algebraofgraphics\
**Created:** [March 15, 2022, 9:16am UTC](https://discourse.julialang.org/t/disable-legend-in-algebraofgraphics/77906 "2022-03-15T09:16:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jakob](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Jakob](https://discourse.julialang.org/u/Jakob)\
**Post date:** [March 15, 2022, 9:16am UTC](https://discourse.julialang.org/t/disable-legend-in-algebraofgraphics/77906/1 "2022-03-15T09:16:41Z")

</div>

Hi everyone,

is there a quick way to disable the legend for a plot created with AOG?

I know that you can pass legend attributes to `draw`, like so:

```julia
d = (;x=[1,2,3], y=[1,2,3], c=["a", "b", "c"])
p = data(d) * mapping(:x, :y, color=:c) * visual(BarPlot)
draw(p; legend=(;position=:bottom))

```

But I didn’t find an overview of the options that can be passed to that.

Thanks!

---

<div class="post-metadata">

**Author:** ![icweaver](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/icweaver/32/45764_2.png) [@icweaver](https://discourse.julialang.org/u/icweaver)\
**Post date:** [March 15, 2022, 9:31am UTC](https://discourse.julialang.org/t/disable-legend-in-algebraofgraphics/77906/2 "2022-03-15T09:31:31Z")

</div>

I think the legend is [baked](https://github.com/JuliaPlots/AlgebraOfGraphics.jl/blob/6ffe13ddc686fc194bd4a980fd2c905aeff9e605/src/draw.jl#L50) into `draw`. It’s not as quick as a flag, but you could use [`draw!`](http://juliaplots.org/AlgebraOfGraphics.jl/dev/API/functions/#AlgebraOfGraphics.draw!) instead:

```julia
f = Figure()
draw!(f, p)
f

```

> But I didn’t find an overview of the options that can be passed to that.

I usually just go to the [docsctrings](https://makie.juliaplots.org/stable/documentation/api_reference/index.html#Legend), or use `help_attributes` for things like `Scatter`, `BarPlot`, etc.

---

<div class="post-metadata">

**Author:** ![Jakob](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Jakob](https://discourse.julialang.org/u/Jakob)\
**Post date:** [March 15, 2022, 10:05am UTC](https://discourse.julialang.org/t/disable-legend-in-algebraofgraphics/77906/3 "2022-03-15T10:05:45Z")

</div>

That makes sense and I guess using `draw!` isn’t too bad. I’ll remember to look at the Makie docstrings next time. Thanks for indulging my questions 🙂
