# Leg = false?

**URL:** <https://discourse.julialang.org/t/leg-false/56523>\
**Category:** New to Julia\
**Created:** [March 5, 2021, 3:20am UTC](https://discourse.julialang.org/t/leg-false/56523 "2021-03-05T03:20:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wei\_Yang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wei_yang/32/23951_2.png) [@Wei\_Yang](https://discourse.julialang.org/u/Wei_Yang)\
**Post date:** [March 5, 2021, 3:20am UTC](https://discourse.julialang.org/t/leg-false/56523/1 "2021-03-05T03:20:21Z")

</div>

Just a quick question, what does leg=false or leg=true mean, for example in the following command  
hline!([m, m+σ, m-σ], lw=3, ls=:dash, leg=false)

I tried to set leg to true and false, but can’t see any observable difference.

Thank you!

---

<div class="post-metadata">

**Author:** ![apo383](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/apo383/32/11272_2.png) [@apo383](https://discourse.julialang.org/u/apo383)\
**Post date:** [March 5, 2021, 3:38am UTC](https://discourse.julialang.org/t/leg-false/56523/2 "2021-03-05T03:38:43Z")

</div>

I’ll guess that you’re talking about Plots.jl, in which case I also guess that “leg” is short for legend and that hline disables legend anyway. You might try setting it to true in a separate plot command which may cause the legend to appear. The imaginary use case is you plot some data and want it to be labeled in a legend, and you add a horizontal or vertical line to the plot and don’t want it labeled like data. I’m speculating and haven’t tried it. Edit: revision

---

<div class="post-metadata">

**Author:** ![Wei\_Yang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wei_yang/32/23951_2.png) [@Wei\_Yang](https://discourse.julialang.org/u/Wei_Yang)\
**Post date:** [March 5, 2021, 3:42am UTC](https://discourse.julialang.org/t/leg-false/56523/3 "2021-03-05T03:42:59Z")

</div>

Thank you! I tried both options many times, but I was focusing too much on the lines and dots and didn’t realized there are differences in the legend. Thank you!

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [March 5, 2021, 6:05am UTC](https://discourse.julialang.org/t/leg-false/56523/5 "2021-03-05T06:05:47Z")

</div>

For the future, the page “attributes” in the Plots documentation lists all of the attributes and their options. This one is probably under subplot attributes.

---

<div class="post-metadata">

**Author:** ![ultradian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ultradian/32/17802_2.png) [@ultradian](https://discourse.julialang.org/u/ultradian)\
**Post date:** [March 5, 2021, 3:17pm UTC](https://discourse.julialang.org/t/leg-false/56523/6 "2021-03-05T15:17:39Z")

</div>

@gustaphe is right on. The documentation is under subplots at [Subplot Attributes · Plots](https://docs.juliaplots.org/latest/generated/attributes_subplot/)

If you look under ‘legend’, you will see that besides using `boolean` values, you can use `leg` to specify the legend location. (although that is irrelevant in this case as @apo383 points out 😄)
