# Subplot in movie

**URL:** <https://forum.generic-mapping-tools.org/t/subplot-in-movie/1472>\
**Category:** Q&A\
**Created:** [March 19, 2021, 3:24am UTC](https://forum.generic-mapping-tools.org/t/subplot-in-movie/1472 "2021-03-19T03:24:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [March 19, 2021, 3:24am UTC](https://forum.generic-mapping-tools.org/t/subplot-in-movie/1472/1 "2021-03-19T03:24:46Z")

</div>

Hi there,

I have some trouble using subplot within the movie module …

```auto
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Main.sh #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # 
gmt begin
gmt grdfilter \${region} \${data}"?u[\${MOVIE_COL0}]" -Fm5 -D4 -I5 -Gtmp_u.nc
gmt grdfilter \${region} \${data}"?v[\${MOVIE_COL0}]" -Fm5 -D4 -I5 -Gtmp_v.nc

gmt subplot begin 2x2 -M2c -Fs15c \${region} \${projection} -T"\${titre}" -Bwesnlbtr

# TL
gmt grdimage -Ca.cpt \${data}"?a[\${MOVIE_COL0}]" -c0,0

# TR
gmt grdimage -Cb.cpt \${data}"?b[\${MOVIE_COL0}]" -c0,1

# BL
gmt grdimage -Cc.cpt \${data}"?c[\${MOVIE_COL0}]" -c1,0

# BR
gmt grdimage -Cd.cpt \${data}"?d[\${MOVIE_COL0}]" -c1,1
gmt grdvector tmp_u.nc tmp_v.nc -W\${v_pen}c,black -Gblack -Si\${v_scale}k -Q\${v_head}c+e+a45+jc+n\$(echo "scale=3; \${v_scale} * 25;"|bc)k

gmt subplot end
gmt end
EOF

# # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Post.sh #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # 

cat << EOF > post.sh
gmt begin 
gmt subplot begin 2x2 -M2c -Fs15c \${region} \${projection} -A -Bwesnlbtr

# TL
gmt coast -Dc -Wthin -c0,0
gmt colorbar -Ca.cpt \${clr_sty} \${clr_atxt}

# TR
gmt coast -Dc -Wthin -c0,1
gmt colorbar -Cb.cpt \${clr_sty} \${clr_btxt}

# BR
gmt coast -Dc -Wthin -c1,0
gmt colorbar -Cc.cpt \${clr_sty} \${clr_ctxt}

# BL
gmt coast -Dc -Wthin -c1,1
gmt colorbar -Cd.cpt \${clr_sty} \${clr_dtxt}
gmt legend -DjTR+w2c+o-5p/1p -F+r4p+pthinnest,gray+gwhite --FONT_ANNOT_PRIMARY=8p <<- END
S - - \$(echo "scale=3; 25 * \${v_scale}/111.132954 * \${map_cm}/(\${lonE}-\${lonW});"|bc)c black \${v_pen}c - 25m.s@+-1@+
END

gmt subplot end
gmt end
EOF

```

This already plot two frames (one is simple, the other is fancy) on top of each other, and they are not perfectly aligned …

 ![Screenshot 2021-03-18 at 23.19.37](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/8/8f9621dc095204f879760a1e623cf588aeb720d5.jpeg)

If I want to add a title to each subplot by adding `-B+t"a title"` in `post.sh`, this shift is even more apparent.

If I use some annotation say, `-Bx30f10 -By10f10` instead of `-Bwesnltrb` in `post.sh`, of course they overlap.

Am I missing something ?
