# How to add plot icon displayed in legend to axis label?

**URL:** <https://discourse.julialang.org/t/how-to-add-plot-icon-displayed-in-legend-to-axis-label/103299>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [August 28, 2023, 4:04pm UTC](https://discourse.julialang.org/t/how-to-add-plot-icon-displayed-in-legend-to-axis-label/103299 "2023-08-28T16:04:39Z")\
**Posts on this page:** 3\
**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:** [August 28, 2023, 4:04pm UTC](https://discourse.julialang.org/t/how-to-add-plot-icon-displayed-in-legend-to-axis-label/103299/1 "2023-08-28T16:04:39Z")

</div>

Is it possible to extract the icon (line, marker, etc) displayed in a typical `Legend` so that I can display them in `ax.xlabel` and `ax.ylabel`?

Edit:

The left plot is what we usually get by using `Legend` (or `axislegend`). I want to produce something similar to the right one where the icon labelling the `ScatterLine` is now displayed in the `ax.ylabel` (or somewhere else like `ax.title`, `Label`, `text!(...)`, etc)

 ![image](https://global.discourse-cdn.com/julialang/original/3X/8/e/8e1d610481829613d2e098370ab714de878aaf2d.png)

---

<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:** [August 28, 2023, 7:36pm UTC](https://discourse.julialang.org/t/how-to-add-plot-icon-displayed-in-legend-to-axis-label/103299/2 "2023-08-28T19:36:09Z")

</div>

I’m not quite sure what you need, why do you want a legend symbol in an x or y label? Do you have a visual example of what you wanted to do?

---

<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:** [August 28, 2023, 7:54pm UTC](https://discourse.julialang.org/t/how-to-add-plot-icon-displayed-in-legend-to-axis-label/103299/4 "2023-08-28T19:54:49Z")

</div>

Just added an example
