# Pygmt Subplot Figsize and Subsize

**URL:** <https://forum.generic-mapping-tools.org/t/pygmt-subplot-figsize-and-subsize/4320>\
**Category:** PyGMT Q&A\
**Tags:** gmt\
**Created:** [October 5, 2023, 7:34am UTC](https://forum.generic-mapping-tools.org/t/pygmt-subplot-figsize-and-subsize/4320 "2023-10-05T07:34:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lee](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@Lee](https://forum.generic-mapping-tools.org/u/Lee)\
**Post date:** [October 5, 2023, 7:34am UTC](https://forum.generic-mapping-tools.org/t/pygmt-subplot-figsize-and-subsize/4320/1 "2023-10-05T07:34:35Z")

</div>

Dear everyone:

 ![image](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/8/8a997b4f17c01f4c516f1aef3c872eeb54f9d956.png) ,when i use vscode complier to run my pygmt script(I want to use pygmt.Figure().subplot method,not setting its subsize),it warnings:subplot [ERROR]: Option -J: Requires -Fs to determine subplot height!  
subplot [ERROR]: No subplot information file!  
And then I add subsize=“5c”,it works, hencely I’m curious about whether “subsize” is essential to use pygmt.Figure().subplot ? but the pygmt docs says that " Note that only one of `figsize` or `subsize` can be provided at once." in section of “subplot”  
Thanks a lot!

---

<div class="post-metadata">

**Author:** ![weiji14](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/weiji14/32/33_2.png) [@weiji14](https://forum.generic-mapping-tools.org/u/weiji14)\
**Post date:** [October 5, 2023, 11:16pm UTC](https://forum.generic-mapping-tools.org/t/pygmt-subplot-figsize-and-subsize/4320/2 "2023-10-05T23:16:13Z")

</div>

> [@Lee](#):
>
> warnings:subplot [ERROR]: Option -J: Requires -Fs to determine subplot height!  
> subplot [ERROR]: No subplot information file!

I see that you have set `projection="Q12c"` in both the `fig.subplot` and `fig.grdimage` commands. Could you try using `projection="Q?"` for your `grdimage` command, while removing the `subsize` parameter from `fig.plot`?

Also, are you using the same `region` and `projection` for all 4 subplots? If all subplots are using the same projection extent, then it is ok to put them in `fig.subplot`. But if each subplot has a different projection or region (e.g. like [Multiple colormaps — PyGMT](https://www.pygmt.org/v0.9.0/gallery/embellishments/colorbars_multiple.html)), then it is better to remove `region` and `parameter` from `fig.subplot`, and place them in your `fig.grdimage` call instead (but change any size like `projection="Q12c"` to `projection="Q?"`)

---

<div class="post-metadata">

**Author:** ![Lee](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@Lee](https://forum.generic-mapping-tools.org/u/Lee)\
**Post date:** [October 6, 2023, 2:31am UTC](https://forum.generic-mapping-tools.org/t/pygmt-subplot-figsize-and-subsize/4320/3 "2023-10-06T02:31:18Z")

</div>

OK,thank you,I understood, thank you very much!~Good Luck!

---

<div class="post-metadata">

**Author:** ![yvonnefroehlich](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/yvonnefroehlich/32/5064_2.png) [@yvonnefroehlich](https://forum.generic-mapping-tools.org/u/yvonnefroehlich)\
**Post date:** [October 6, 2023, 8:13pm UTC](https://forum.generic-mapping-tools.org/t/pygmt-subplot-figsize-and-subsize/4320/4 "2023-10-06T20:13:51Z")

</div>

On tip for next time posting or if you need more help on this issue, please do not post screenshots but simply copy & past your code and provide all needed data 🙂. This makes it significantly easier for people to help you, as we can simply copy and run your code. You can format your script as code by placing three backticks in the line before and after the block with the script:

````auto
```
your script formated as code
```

````

---

<div class="post-metadata">

**Author:** ![Lee](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@Lee](https://forum.generic-mapping-tools.org/u/Lee)\
**Post date:** [October 7, 2023, 2:15am UTC](https://forum.generic-mapping-tools.org/t/pygmt-subplot-figsize-and-subsize/4320/5 "2023-10-07T02:15:24Z")

</div>

Thank you for your sincerely advice ,I’ll notice next time~
