# How to change thickness of frame in pygmt

**URL:** <https://forum.generic-mapping-tools.org/t/how-to-change-thickness-of-frame-in-pygmt/3595>\
**Category:** Q&A\
**Created:** [January 9, 2023, 11:41pm UTC](https://forum.generic-mapping-tools.org/t/how-to-change-thickness-of-frame-in-pygmt/3595 "2023-01-09T23:41:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtabbakhha](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@mtabbakhha](https://forum.generic-mapping-tools.org/u/mtabbakhha)\
**Post date:** [January 9, 2023, 11:41pm UTC](https://forum.generic-mapping-tools.org/t/how-to-change-thickness-of-frame-in-pygmt/3595/1 "2023-01-09T23:41:44Z")

</div>

Hi there.  
Is the anyway to increase the thickness of frame around the figure?

---

<div class="post-metadata">

**Author:** ![biggle1856](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/biggle1856/32/3169_2.png) [@biggle1856](https://forum.generic-mapping-tools.org/u/biggle1856)\
**Post date:** [January 10, 2023, 7:42am UTC](https://forum.generic-mapping-tools.org/t/how-to-change-thickness-of-frame-in-pygmt/3595/2 "2023-01-10T07:42:03Z")

</div>

have a look at gmtdefaults for settings starting MAP\_FRAME\_

---

<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:** [January 10, 2023, 9:01pm UTC](https://forum.generic-mapping-tools.org/t/how-to-change-thickness-of-frame-in-pygmt/3595/3 "2023-01-10T21:01:12Z")

</div>

Hello @mtabbakhha,

as mentioned by @biggle1856 changing the frame thickness of a map can be accomplished by configuring the GMT default values. An overview of all available GMT default parameters can be found at [gmt.conf — GMT 6.4.0 documentation (generic-mapping-tools.org)](https://docs.generic-mapping-tools.org/latest/gmt.conf.html).

Below, please find a code example how to change the frame thickness in PyGMT. For a more detailed introduction on configuring GMT defaults within PyGMT, you may also want to have a look at this PyGMT tutorial [Configuring PyGMT defaults — PyGMT](https://www.pygmt.org/v0.8.0/tutorials/advanced/configuration.html).

_Code example_:

```python
import pygmt 

fig = pygmt.Figure()

# global changes of GMT default values          
pygmt.config(
    MAP_FRAME_WIDTH="10p",
    MAP_FRAME_TYPE="fancy",
)

fig.basemap(
    region=[0, 10, 0, 10],
    projection="M10c",
    frame="afg",
)

fig.show()
# fig.savefig(fname="frame_thickness.png")

```

_Output figure_:

 ![frame_thickness](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/2/253979503fc27319cf15c10d73a29af707b04c2b.png)

---

<div class="post-metadata">

**Author:** ![mtabbakhha](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@mtabbakhha](https://forum.generic-mapping-tools.org/u/mtabbakhha)\
**Post date:** [January 10, 2023, 10:42pm UTC](https://forum.generic-mapping-tools.org/t/how-to-change-thickness-of-frame-in-pygmt/3595/4 "2023-01-10T22:42:09Z")

</div>

Thank you very much for your response. I have one more question. I need to add some white margin around the map in all 4 directions (top bottom left right). Can you please help me how to do that?

---

<div class="post-metadata">

**Author:** ![maxrjones](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/maxrjones/32/2698_2.png) [@maxrjones](https://forum.generic-mapping-tools.org/u/maxrjones)\
**Post date:** [January 23, 2023, 5:20pm UTC](https://forum.generic-mapping-tools.org/t/how-to-change-thickness-of-frame-in-pygmt/3595/5 "2023-01-23T17:20:03Z")

</div>

You can use the `crop` parameter for `Figure.show` / `Figure.savefig`:

```python
fig = pygmt.Figure()
fig.basemap(region=[0, 1, 0, 1], frame=True, projection="X10c")
fig.show(crop="10c")

```
