# Question about plot editing

**URL:** <https://forum.generic-mapping-tools.org/t/question-about-plot-editing/2435>\
**Category:** PyGMT Q&A\
**Created:** [December 10, 2021, 5:45pm UTC](https://forum.generic-mapping-tools.org/t/question-about-plot-editing/2435 "2021-12-10T17:45:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Remy](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/remy/32/1905_2.png) [@Remy](https://forum.generic-mapping-tools.org/u/Remy)\
**Post date:** [December 10, 2021, 5:45pm UTC](https://forum.generic-mapping-tools.org/t/question-about-plot-editing/2435/1 "2021-12-10T17:45:25Z")

</div>

Hello,

Here is the script :

> import pygmt  
> #pygmt.show\_versions() ;  
> import pandas as pd  
> #pandas. **version** ;  
> from pygmt.src import which
> 
> def Massin\_M4\_clean():
> 
> ```
> fname = which("Massin_M4_clean.dat")
> data = pd.read_csv(fname, header=1, sep=r"\s+")
> data.columns = [
> "year",
> "latitude",
> "longitude",
> "depth_km",
> "magnitude",
> ]
> return data
> 
> ```
> 
> data = pd.DataFrame(Massin\_M4\_clean())
> 
> region = pygmt.info(  
> data=data[[“longitude”, “latitude”, “depth\_km”]],  
> per\_column=True,  
> )
> 
> R = [-64, -58, 11, 19]
> 
> Perspective = [135, 25]
> 
> fig = pygmt.Figure()
> 
> pygmt.makecpt(cmap=“rainbow”,A = 10, series=[data.depth\_km.min(), data.depth\_km.max()])
> 
> fig.plot3d(
> 
> ```
> x=data.longitude,
> y=data.latitude,
> z=-(data.depth_km),
> 
> size=0.02 * (2 ** data.magnitude),
> 
> projection="M8i",
> 
> style="u",
> pen="black",
> 
> color=data.depth_km,
> 
> cmap=True,
> 
> region=[
> data.longitude.min(),
> data.longitude.max(),
> data.latitude.min(),
> data.latitude.max(),
> -(data.depth_km.max()),
> data.depth_km.min(),
> ],
> 
> frame=[
>     
> 'SEnwZ1+b+t"French Antilles seismicity"', 
>     
> 'xafg+l"latitude (cm)"',
> 'yafg+l"longitude (cm)"',
> 'zafg+l"depth_km"',
> ],
> label=['z+w1p'], 
> 
> perspective= Perspective,
> 
> zscale=0.1,
> 
> ```
> 
> )
> 
> fig.coast(shorelines=“1p,black”, region=region, projection=“M8i”, land=“#ffe398”,perspective=Perspective,yshift=24.3)
> 
> fig.colorbar(frame=‘af+l"Depth (km)"’,xshift=3.1,yshift= -25.3)
> 
> fig.show()
> 
> fig.savefig(“central-america-shorelines.png”)

And the resulting figure:

 ![central-america-shorelines](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/9/90dc3c4c27139e3614a4504e6e5d5265a6d4278e.png)

1 - I would like to know how to enlarge the font of the axes  
2 - How do I add scaling to my X and Y axes?  
3- Is it possible to replace the cubes by spheres? I have searched the GMT instructions “[-S[symbol][size]](https://docs.generic-mapping-tools.org/latest/plot3d.html#s)”, but the only 3D figure is a cube, the rest is 2D…

thank you in advance for the help! 😁

---

<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:** [December 16, 2021, 9:51pm UTC](https://forum.generic-mapping-tools.org/t/question-about-plot-editing/2435/2 "2021-12-16T21:51:42Z")

</div>

Hi @Remy, thanks for trying out PyGMT! To answer your questions:

> [@Remy](#):
>
> 1 - I would like to know how to enlarge the font of the axes

This can be done using [`pygmt.config`](https://www.pygmt.org/v0.5.0/api/generated/pygmt.config.html). It is a bit of an advanced feature, but try something like:

```python
with pygmt.config(FONT_ANNOT_PRIMARY="20p"):
    fig.plot3d(...)

```

Full list of `FONT` parameters you can tweak are at [gmt.conf — GMT 6.3.0 documentation](https://docs.generic-mapping-tools.org/6.3/gmt.conf.html#font-parameters).

> [@Remy](#):
>
> 2 - How do I add scaling to my X and Y axes?

Could you define what you mean by scaling? If you want to add extra annotations, try something like `frame=["xa1fg", "ya2fg"]` which would set **a** nnotations every 1 degree longitude and 2 degrees latitude (instead of 2 and 5 degrees currently). If you mean scaling the coordinates, maybe check out [Scaling map annotations from metres to kilometes](https://flint.soest.hawaii.edu/t/scaling-map-annotations-from-metres-to-kilometes/105) (though that is for Cartesian coordinates).

> [@Remy](#):
>
> 3- Is it possible to replace the cubes by spheres? I have searched the GMT instructions “[-S[symbol][size]](https://docs.generic-mapping-tools.org/latest/plot3d.html#s)”, but the only 3D figure is a cube, the rest is 2D…

Unfortunately no, only cubes are currently supported for `plot3d` if you want 3-D 😅

---

<div class="post-metadata">

**Author:** ![Remy](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/remy/32/1905_2.png) [@Remy](https://forum.generic-mapping-tools.org/u/Remy)\
**Post date:** [December 22, 2021, 6:02pm UTC](https://forum.generic-mapping-tools.org/t/question-about-plot-editing/2435/3 "2021-12-22T18:02:59Z")

</div>

Hi @weiji14,

Thank you so much for these precisions, it will help me !

> Could you define what you mean by scaling?

It was for add extra annotations 😉
