# How to give names to the curves in 1D graph of 2D array?

**URL:** <https://discourse.julialang.org/t/how-to-give-names-to-the-curves-in-1d-graph-of-2d-array/89182>\
**Category:** Visualization\
**Created:** [October 24, 2022, 6:25am UTC](https://discourse.julialang.org/t/how-to-give-names-to-the-curves-in-1d-graph-of-2d-array/89182 "2022-10-24T06:25:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Raf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raf/32/3383_2.png) [@Raf](https://discourse.julialang.org/u/Raf)\
**Post date:** [October 24, 2022, 11:25am UTC](https://discourse.julialang.org/t/how-to-give-names-to-the-curves-in-1d-graph-of-2d-array/89182/2 "2022-10-24T11:25:33Z")

</div>

Since you’re already a bit familiar with it, DimensionalData.jl should do this for you pretty easily:

```julia
using Plots
arr = hcat([1,2,4], [-1,-2,-4])
da = DimArray(arr, (X(100:100:300), Y(["positive", "negative"])))
plot(da)

```

The trick is to use `permutedims` rather than `'`. Adjoint is annoyingly recursive so wont work on strings.

```julia
plot(xaxis, arr; label=permutedims(nams))

```

---

_[View the full topic](https://discourse.julialang.org/t/how-to-give-names-to-the-curves-in-1d-graph-of-2d-array/89182)._
