# How to plot a circle?

**URL:** <https://forum.generic-mapping-tools.org/t/how-to-plot-a-circle/763>\
**Category:** PyGMT Q&A\
**Created:** [August 12, 2020, 4:05am UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-a-circle/763 "2020-08-12T04:05:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pan3rock](https://avatars.discourse-cdn.com/v4/letter/p/4bbf92/32.png) [@pan3rock](https://forum.generic-mapping-tools.org/u/pan3rock)\
**Post date:** [August 12, 2020, 4:05am UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-a-circle/763/1 "2020-08-12T04:05:18Z")

</div>

I would like to plot a circle with (lat, lon, radius), search for it in google. It seems that `gmt psxy pratt.txt -R -J -O -K -SE- -Wthinnest >> $ps` and how to implement it by pygmt?

```python
    import pygmt
    region = "-180/180/-90/-60"
    projection = "s0/-90/-71/1:33000000"
    fig = pygmt.Figure()
    fig.coast(region=region,
                  projection=projection,
                  frame='afg',
                  resolution='i',
                  shorelines='0.3p')
    fig.plot([170], [-80], sizes=[200], style='E') # not work

```

---

<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:** [August 12, 2020, 10:28pm UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-a-circle/763/2 "2020-08-12T22:28:02Z")

</div>

Hi @pan3rock,

Great to see another Antarctic scientist 😄. You’re actually just missing a dash ‘-’ in the command (should be `style="E-"`), and probably need to set a `pen` too. Try this:

```python
import pygmt

region = [-180, 180, -90, -60]
projection = "s0/-90/-71/1:33000000"
fig = pygmt.Figure()
fig.coast(
    region=region, projection=projection, frame="afg", resolution="i", shorelines="0.3p"
)
fig.plot(x=[170], y=[-80], sizes=[200], style="E-", pen="1.5p,purple2")
fig.show()

```

produces:

 ![Ross_Ice_Shelf_study_area_1](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/ec7be24ae3cd4213d2aca9408dc419178a2b9545.png)

By the way, you can also plot the grounding line using `area_thresh="+ag"` (see coast’s [`-A`](https://docs.generic-mapping-tools.org/latest/coast#a) option), and label you study area like so:

```python
import pygmt

region = [-180, 180, -90, -60]
projection = "s0/-90/-71/1:33000000"
fig = pygmt.Figure()
fig.coast(
    region=region,
    projection=projection,
    area_thresh="+ag",
    frame="afg",
    resolution="i",
    shorelines="0.3p",
)
fig.plot(
    x=[170],
    y=[-80],
    sizes=[200],
    style="E-",
    pen="1.5p,purple2",
    label='"Ross Ice Shelf study area"',
)
fig.legend()
fig.show()

```

produces:

 ![Ross_Ice_Shelf_study_area](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/bb23e10e732ff1bfb0af79bf3e604d5f014c87a1.png)

Let me know if that helps. There doesn’t seem to be a way to simultaneously plot both the ice shelf ‘coastline’ and grounding line (using `-Aig`) but we could raise that as a feature request 😄

---

<div class="post-metadata">

**Author:** ![pan3rock](https://avatars.discourse-cdn.com/v4/letter/p/4bbf92/32.png) [@pan3rock](https://forum.generic-mapping-tools.org/u/pan3rock)\
**Post date:** [August 14, 2020, 2:27am UTC](https://forum.generic-mapping-tools.org/t/how-to-plot-a-circle/763/3 "2020-08-14T02:27:21Z")

</div>

Thank you very much. I’m trying to add plotting functional to my python codes and your answer helps me a lot. 😃
