# Question about plot 3d in Pygmt

**URL:** <https://forum.generic-mapping-tools.org/t/question-about-plot-3d-in-pygmt/3090>\
**Category:** PyGMT Q&A\
**Created:** [July 4, 2022, 5:52pm UTC](https://forum.generic-mapping-tools.org/t/question-about-plot-3d-in-pygmt/3090 "2022-07-04T17:52:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![quake10](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/quake10/32/2363_2.png) [@quake10](https://forum.generic-mapping-tools.org/u/quake10)\
**Post date:** [July 4, 2022, 5:52pm UTC](https://forum.generic-mapping-tools.org/t/question-about-plot-3d-in-pygmt/3090/1 "2022-07-04T17:52:29Z")

</div>

Hello guys:  
please help me

How to get the base map to be in the right position with plot3d?

The script bellow:

import pygmt  
import pandas as pd

#Read Data  
data = pd.read\_csv(‘Sulut\_Catalog.csv’)  
#Region  
minlon, maxlon = 119.009904, 129.543823  
minlat, maxlat = -1.916803, 6.398782  
mindepth, maxdepth = -1000,0  
region = [minlon,maxlon,minlat,maxlat,mindepth,maxdepth]

#pygmt Figure  
fig = pygmt.Figure()  
#Set the azimuth and elevation angle  
perspective=[165,15]  
#make color ramp for depth  
pygmt.makecpt(cmap=“jet”, series=[data.depth.min(),data.depth.max()])  
#plot 3d  
fig.plot3d (region = region,  
x = data.longitude,  
y = data.latitude,  
z = data.depth \* -1,  
size = 0.002 \* (2\*\*data.magnitude),  
projection =‘M8i’,  
style=“u”,  
pen=“black”,  
color=data.depth,  
cmap = True,  
frame=[‘SEnwZ1+b+t""’,‘xafg+l"latitude"’,‘yafg+l"longitude"’,‘zafg+l"depth (km)"’,],  
label=[‘z+w1p’],  
#frame =[“WsNeZ3”,‘xafg+l"longitude"’,‘yafg+l"latitude"’,‘zafg+l"Depth (km)"’],  
perspective=perspective,  
zscale=“0.01”)

#Plot basemap  
fig.coast(region=[minlon,maxlon,minlat,maxlat],  
projection=‘M8i’,  
shorelines=‘0.25p,black’,  
land=‘grey’,  
#water=‘lightblue’,  
perspective=perspective,  
yshift=24.3)

#Plot colorbar  
fig.colorbar(frame=‘af+l"Depth (km)"’,xshift=3.1,yshift= -25.3)

 ![Earthquake_map3d-1](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/2X/9/93cdb48797435c4037c71b7631fb024de4d37358.png)

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [July 5, 2022, 1:17am UTC](https://forum.generic-mapping-tools.org/t/question-about-plot-3d-in-pygmt/3090/2 "2022-07-05T01:17:00Z")

</div>

What is the “the right position”? Do you mean just in top of the 3d block?

If so, maybe you could try changing `yshift=24.3`.

---

<div class="post-metadata">

**Author:** ![quake10](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/quake10/32/2363_2.png) [@quake10](https://forum.generic-mapping-tools.org/u/quake10)\
**Post date:** [July 5, 2022, 4:32am UTC](https://forum.generic-mapping-tools.org/t/question-about-plot-3d-in-pygmt/3090/3 "2022-07-05T04:32:17Z")

</div>

yes I do  
I mean the basemap just in top the 3d block

anyway Thanks for your suggestion

---

<div class="post-metadata">

**Author:** ![quake10](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/quake10/32/2363_2.png) [@quake10](https://forum.generic-mapping-tools.org/u/quake10)\
**Post date:** [July 5, 2022, 4:40am UTC](https://forum.generic-mapping-tools.org/t/question-about-plot-3d-in-pygmt/3090/4 "2022-07-05T04:40:36Z")

</div>

Thanks a lot sir. Esteban82  
when I change the script yshift =10  
the basemap just in top of the 3d block
