Created
February 8, 2017 11:18
-
-
Save emolch/4a28c9dff66b9a12e601ed26f1668876 to your computer and use it in GitHub Desktop.
How to plot full MT, deviatoric and double-couble focal mechanism solutions with Pyrocko
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from matplotlib import pyplot as plt | |
from pyrocko import beachball, moment_tensor as pmt, plot | |
fig = plt.figure(figsize=(4., 2.)) | |
fig.subplots_adjust(left=0., right=1., bottom=0., top=1.) | |
axes = fig.add_subplot(1, 1, 1) | |
axes.set_xlim(0., 4.) | |
axes.set_ylim(0., 2.) | |
axes.set_axis_off() | |
for i, beachball_type in enumerate(['full', 'deviatoric', 'dc']): | |
beachball.plot_beachball_mpl( | |
pmt.as_mt((124654616., 370943136., -6965434.0, | |
553316224., -307467264., 84703760.0)), | |
axes, | |
beachball_type=beachball_type, | |
size=60., | |
position=(i+1, 1), | |
color_t=plot.mpl_color('scarletred2'), | |
linewidth=1.0) | |
fig.savefig('beachball.png') | |
# plt.show() |
Author
emolch
commented
Feb 8, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment