# Annotation for each row and column of subplots in layout, plot by column in layout, copy figure

**URL:** https://discourse.julialang.org/t/annotation-for-each-row-and-column-of-subplots-in-layout-plot-by-column-in-layout-copy-figure/40258
**Category:** General Usage
**Tags:** question, plotting
**Created:** [May 27, 2020, 2:29pm UTC](https://discourse.julialang.org/t/annotation-for-each-row-and-column-of-subplots-in-layout-plot-by-column-in-layout-copy-figure/40258 "2020-05-27T14:29:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)
#### Post date: [May 27, 2020, 2:29pm UTC](https://discourse.julialang.org/t/annotation-for-each-row-and-column-of-subplots-in-layout-plot-by-column-in-layout-copy-figure/40258/1 "2020-05-27T14:29:25Z")

</div>

Hi,  
(1) except `annotate!()`, is there any method to set the annotation for each row and column (as highlighted) in plot layout?

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

(2) And also any shortkey or quick way of copying the plot generated by Atom instead of going further as `savefig()` ?

(3) how to align subplots by column like  
1 3 5  
2 4 6

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [May 27, 2020, 4:52pm UTC](https://discourse.julialang.org/t/annotation-for-each-row-and-column-of-subplots-in-layout-plot-by-column-in-layout-copy-figure/40258/2 "2020-05-27T16:52:37Z")

</div>

The answers to (1) and (2) are no, I believe, the answer to (3) is to [use layouts](https://docs.juliaplots.org/latest/layouts/)

---

<div class="post-metadata">

### Author: ![josephmarturano](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@josephmarturano](https://discourse.julialang.org/u/josephmarturano)
#### Post date: [May 27, 2020, 7:21pm UTC](https://discourse.julialang.org/t/annotation-for-each-row-and-column-of-subplots-in-layout-plot-by-column-in-layout-copy-figure/40258/3 "2020-05-27T19:21:57Z")

</div>

For (1), one method might be to use linebreaks (`\n`) in the `ylabel` and `title` keywords using Plots:

```julia
using Plots, Plots.PlotMeasures
gr(size=(1200,800), xtickfontsize=13, ytickfontsize=13, xguidefontsize=16, yguidefontsize=20, legendfontsize=12, titlefontsize=20, dpi=100)
offsetlines = plot(rand(10), ylabel="top line \n \n \n bottom line", title="top line \n \n \n bottom line", margin=10mm)
savefig(offsetlines, "offsetlines.png")

```

which produces the following:

 ![offsetlines](https://global.discourse-cdn.com/julialang/original/3X/4/6/468258455b7b3d85070556e612f8f5e021539611.png)

---

<div class="post-metadata">

### Author: ![1634](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/1634/32/12119_2.png) [@1634](https://discourse.julialang.org/u/1634)
#### Post date: [May 28, 2020, 10:51am UTC](https://discourse.julialang.org/t/annotation-for-each-row-and-column-of-subplots-in-layout-plot-by-column-in-layout-copy-figure/40258/4 "2020-05-28T10:51:38Z")

</div>

Do you mean by [Adding Subplots incrementally](https://docs.juliaplots.org/latest/layouts/#Adding-Subplots-incrementally-1)?

```julia
using Plots
l = @layout [a c; b d] #doesn't make it arrange by column
    p1 = plot(rand(10), title="1")
    p2 = plot(rand(10), title="2")
    p3 = plot(rand(10), title="3")
    p4 = plot(rand(10), title="4")
    plot(p1, p2, p3, p4, layout = l)

    plot(p1, p3, p2, p4, layout = l) #instead this works

```

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [May 28, 2020, 1:41pm UTC](https://discourse.julialang.org/t/annotation-for-each-row-and-column-of-subplots-in-layout-plot-by-column-in-layout-copy-figure/40258/5 "2020-05-28T13:41:56Z")

</div>

Whatever works I guess!
