# Subplot of a subplot

**URL:** <https://forum.generic-mapping-tools.org/t/subplot-of-a-subplot/4369>\
**Category:** Q&A\
**Created:** [October 23, 2023, 8:56am UTC](https://forum.generic-mapping-tools.org/t/subplot-of-a-subplot/4369 "2023-10-23T08:56:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pa345](https://avatars.discourse-cdn.com/v4/letter/p/e79b87/32.png) [@pa345](https://forum.generic-mapping-tools.org/u/pa345)\
**Post date:** [October 23, 2023, 8:56am UTC](https://forum.generic-mapping-tools.org/t/subplot-of-a-subplot/4369/1 "2023-10-23T08:56:23Z")

</div>

I want to visualize data on a global Earth, with views of the equatorial region (Mollweide, -JW), and separate views of the north/south poles (orthographic, -JG). To keep things compact, I’d like a layout like the following:

```
Row 1: Mollweide1 Mollweide2 Mollweide3
Row 2: Ortho1a Ortho1b Ortho2a Ortho2b Ortho3a Ortho3b

```

So in other words, I want to fit 2 orthographic maps in the same horizontal space as a single Mollweide map in the previous row. So essentially for the second row, I want to divide each panel into 2 equal panels (subplot of a subplot).

Here is an attempt I made to do this:

```
#!/usr/bin/env bash

EQMERIDIAN="180"

# subplot dimensions
SUBPLOT_WIDTH1="3i"
SUBPLOT_WIDTH2="1.5i"
SUBPLOT_HEIGHT="1.5i"

gmt set MAP_FRAME_TYPE plain

eq_proj="-JW${EQMERIDIAN}/${SUBPLOT_WIDTH1} -Rg"
np_proj="-JG0/90/${SUBPLOT_HEIGHT} -R-180/180/60/90"
sp_proj="-JG180/-90/${SUBPLOT_HEIGHT} -R/-180/180/-90/-60"

gmt begin figure png

  gmt subplot begin 1x3 -Fs${SUBPLOT_WIDTH1}/${SUBPLOT_HEIGHT}

    gmt subplot set 0,0
    gmt basemap ${eq_proj} -B0

    gmt subplot set 0,1
    gmt basemap ${eq_proj} -B0

    gmt subplot set 0,2
    gmt basemap ${eq_proj} -B0

  gmt subplot end

  gmt subplot begin 1x6 -Fs${SUBPLOT_WIDTH2}/${SUBPLOT_HEIGHT}

    gmt subplot set 0,0
    gmt basemap ${np_proj} -B0

    gmt subplot set 0,1
    gmt basemap ${sp_proj} -B0

    gmt subplot set 0,2
    gmt basemap ${np_proj} -B0

    gmt subplot set 0,3
    gmt basemap ${sp_proj} -B0

    gmt subplot set 0,4
    gmt basemap ${np_proj} -B0

    gmt subplot set 0,5
    gmt basemap ${sp_proj} -B0

  gmt subplot end

gmt end show

```

And here is the result:

 ![figure](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/f/f60e9c0a950b049dcc77dbfdcce75c0d19063b04.png)

Can anyone suggest how to fix the plot? Also, if anyone knows of a nicer way to visualize all areas of the Earth in some nice way, I’d be interested in an example 🙂

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [October 23, 2023, 9:30am UTC](https://forum.generic-mapping-tools.org/t/subplot-of-a-subplot/4369/2 "2023-10-23T09:30:04Z")

</div>

Suggest you do 2x3 with desired size for your -JW, then for row two you will need to plot two orthplots in each panel, using -X and -J with arguments to place the two as you want them.
