plot.plot_inputs_3d¶
plot_inputs_3d(data, fig=None, perspective=[135,30], zscale=0.01, region=None, etype=None, show=False)
Helper function for 3d plotting, plots input data as a 3d scatter plot.
Arguments:¶
data (pd.DataFrame or str): dataframe containing input data for the given slab model
fig (pygmt.Figure, optional): figure object to plot data onto. Defaults to None.
perspective (list, optional): list of [azimuth angle, vertical angle] defining plot perspective. Defaluts to [135,30].
zscale (float, optional): scaling factor for z-axis. Defaults to 0.01.
region (list, optional): region boundaries for the model. Defaults to None.
etype (list, optional): specifies type(s) of input data to plot. Defaults to None (plots all types).
Returns:¶
None
Example¶
import plot
import pygmt
# load in the synthetic test model as a slab_model instance
model = plot.slab_model("../output/exp_slab2_04-18","surface") # synthetic test slab made with the 04-18 database
# initialize figure
fig = pygmt.Figure()
# making a 3d plot of slab depth
plot.plot_3d(
model.dep_grid, # specify the depth grid object
fig=fig, # add this plot to the existing figure object
perspective=[135,30], # specify the viewing angle with an azimuth of 135 degrees and vertical 30 degrees from the horizon
show=False, # display the figure
)
# adding input data to the plot
plot.plot_inputs_3d(
model.input, # input dataset to plot
fig=fig, # add this plot to the existing figure object
perspective=[135,30], # specify the viewing angle with an azimuth of 135 degrees and vertical 30 degrees from the horizon
region=plot.get_region(model.dep_grid), # use the grid to define the region to use
etype="EQ", # constrain the dataset to only earthquake events
)
# save the figure to a jpeg file
fig.savefig("output/exp_slap2_dep_with_input_3d.jpg")
# display the figure
fig.show()

Output of example shown above¶