# Map spanning across two subplots

**URL:** <https://forum.generic-mapping-tools.org/t/map-spanning-across-two-subplots/3460>\
**Category:** Q&A\
**Created:** [November 17, 2022, 5:20am UTC](https://forum.generic-mapping-tools.org/t/map-spanning-across-two-subplots/3460 "2022-11-17T05:20:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![richannan](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@richannan](https://forum.generic-mapping-tools.org/u/richannan)\
**Post date:** [November 17, 2022, 5:20am UTC](https://forum.generic-mapping-tools.org/t/map-spanning-across-two-subplots/3460/1 "2022-11-17T05:20:28Z")

</div>

Hello GMT family,  
I want to draw three auto-tagged maps in a 2x2 subplot, such that the first map spans across the upper half of the figure. So, my figure should be something like an up-down flip of the one on the right. Can someone kindly help me out? Thanks very much.  
This is the script I used:

```auto
gmt begin QQQ png
	gmt subplot begin 2x2 -A+JTL+o-0.15i/0.07i -Fs6.2i/3i -M0i/0.3i -Rd -JH13.5c -Bxa60 -Bya0
		gmt subplot set 0:1 -A"a)"
		gmt coast -A3000 -Gpeachpuff4 -Dh -Wthinnest -Slightblue
		gmt subplot set 2 -A"b)"
		gmt coast -A3000 -Ggray60 -Dh -Wthinnest -Sazure1
		gmt subplot set 3 -A"c)"
		gmt coast -A3000 -Gdarkbrown -Dh -Wthinnest -Sgray72
	gmt subplot end
gmt end show 

```

 ![Screenshot_20221117_010928](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/a/aa8f0b0d62ecd9cb2647bd70fe1a27ff0da99c5d.jpeg)

---

<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:** [November 17, 2022, 11:57pm UTC](https://forum.generic-mapping-tools.org/t/map-spanning-across-two-subplots/3460/2 "2022-11-17T23:57:41Z")

</div>

I’m interested too.  
Maybe using -Ff instead of -Fs, then a 2x2 mapping except one is twice as wide (and there’s no fourth)?

---

<div class="post-metadata">

**Author:** ![seisman](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/seisman/32/4_2.png) [@seisman](https://forum.generic-mapping-tools.org/u/seisman)\
**Post date:** [November 18, 2022, 12:56am UTC](https://forum.generic-mapping-tools.org/t/map-spanning-across-two-subplots/3460/3 "2022-11-18T00:56:14Z")

</div>

The GMT China community provides an example that is almost exactly what you need.

> **[复杂布局 - GMT 子图模式 — GMT 中文手册](https://docs.gmt-china.org/latest/tutorial/subplot/#id3)**
>
> 有些时候，尤其是发表文章时，需要将多张独立的图放在一张图中，并编号 abcd， 一般称这些独立的图为子图。

 ![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/e/e723ab5c72f612a25897c0c3963da6891916dd08.png)

The example plots Cartesian frames but it also works for geographic maps. The key point in this example is that you need to call `subplot begin` twice because GMT doesn’t support nested subplot yet.

---

<div class="post-metadata">

**Author:** ![richannan](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@richannan](https://forum.generic-mapping-tools.org/u/richannan)\
**Post date:** [November 18, 2022, 4:27am UTC](https://forum.generic-mapping-tools.org/t/map-spanning-across-two-subplots/3460/4 "2022-11-18T04:27:12Z")

</div>

Hello @seisman, thank you very much for the response. I will try it out.

---

<div class="post-metadata">

**Author:** ![richannan](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@richannan](https://forum.generic-mapping-tools.org/u/richannan)\
**Post date:** [November 18, 2022, 1:54pm UTC](https://forum.generic-mapping-tools.org/t/map-spanning-across-two-subplots/3460/5 "2022-11-18T13:54:44Z")

</div>

Hi @milton, I think you will need to use both -Ff and -Fs if you want geographic maps. Based on the answer from @seisman, this is what I’ve done:

```auto
gmt begin QQQ png		
	gmt subplot begin 1x2 -A+JTL+o0i/-0.1i -Fs6.2i/3i -M0.15i/0i	
		gmt subplot set 0,0 -A"b)"
			gmt coast -A3000 -Gpeachpuff4 -Df -Wthinnest -Slightblue -Rd -JH13.5c -Bxa60 -Bya0 
						
		gmt subplot set 0,1 -A"c)"
			gmt set FONT_ANNOT_PRIMARY 8p,Helvetica,black
			gmt set MAP_GRID_PEN_PRIMARY 0.01p,gray			
			gmt basemap -JX6.5c/7.0c -R-300/300/0/6 -Bxa100g100+l"x-axis" -Bya1g0.5f0.5+l"y-axis"
	gmt subplot end

	gmt subplot begin 1x1 -A+JTL+o0i/-0.2i -Ff6.2i/5i -M0.0i/0.05i -Bxa60 -Bya0 -Yh+1.7c
		gmt subplot set 0,0 -A"a)"	
		gmt coast -A3000 -Gpeachpuff4 -Sazure -Df -Wthinnest -JH0/24c -Rd 			
						
	gmt subplot end

gmt end show

```

 ![QQQ](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/6/6f8f609be72f233462e45cafaf56212971f433d8.png)
