# obspy.imaging.mopad_wrapper.beachball

`beachball`(fm, linewidth=2, facecolor='b', bgcolor='w', edgecolor='k', alpha=1.0, xy=(0, 0), width=200, size=100, nofill=False, zorder=100, mopad_basis='USE', outfile=None, format=None, fig=None)

  Draws a beach ball diagram of an earthquake focal mechanism. Based on MoPaD.

  S1, D1, and R1, the strike, dip and rake of one of the focal planes, can be vectors of multiple focal mechanisms.

  Parameters: | fm Focal mechanism that is either number of mechanisms (NM) by 3 (strike, dip, and rake) or NM x 6 (M11, M22, M33, M12, M13, M23 - the six independent components of the moment tensor, where the coordinate system is 1,2,3 = Up,South,East which equals r,theta,phi). The strike is of the first plane, clockwise relative to north. The dip is of the first plane, defined clockwise and perpendicular to strike, relative to horizontal such that 0 is horizontal and 90 is vertical. The rake is of the first focal plane solution. 90 moves the hanging wall up-dip (thrust), 0 moves it in the strike direction (left-lateral), -90 moves it down-dip (normal), and 180 moves it opposite to strike (right-lateral). facecolor Color to use for quadrants of tension; can be a string, e.g. `'r'`, `'b'` or three component color vector, [R G B]. Defaults to `'b'` (blue). bgcolor The background color. Defaults to `'w'` (white). edgecolor Color of the edges. Defaults to `'k'` (black). alpha The alpha level of the beach ball. Defaults to `1.0` (opaque). xy Origin position of the beach ball as tuple. Defaults to `(0, 0)`. width (int) Symbol size of beach ball. Defaults to `200`. size Controls the number of interpolation points for the curves. Minimum is automatically set to `100`. nofill Do not fill the beach ball, but only plot the planes. zorder Set zorder. Artists with lower zorder values are drawn first. mopad_basis The basis system. Defaults to `'USE'`. See the Supported Basis Systems section below for a full list of supported systems. outfile Output file string. Also used to automatically determine the output format. Supported file formats depend on your matplotlib backend. Most backends support png, pdf, ps, eps and svg. Defaults to `None`. format Format of the graph picture. If no format is given the outfile parameter will be used to try to automatically determine the output format. If no format is found it defaults to png output. If no outfile is specified but a format is, than a binary imagestring will be returned. Defaults to `None`. fig Give an existing figure instance to plot into. New Figure if set to `None`.

  Supported Basis Systems

  Short | Basis vectors | Usage
  --- | --- | ---
  `'NED'` | North, East, Down | Jost and Herrmann 1989
  `'USE'` | Up, South, East | Global CMT Catalog, Larson et al. 2010
  `'XYZ'` | East, North, Up | General formulation, Jost and Herrmann 1989
  `'RT'` | Radial, Transverse, Tangential | psmeca (GMT), Wessel and Smith 1999
  `'NWU'` | North, West, Up | Stein and Wysession 2003

  Examples

  1. Using basis system `'NED'`.

         >>> from obspy.imaging.mopad_wrapper import beachball
         >>> mt = [1, 2, 3, -4, -5, -10]
         >>> beachball(mt, mopad_basis='NED')

     (Source code)

### Thank you!

We would like to thank our contributors, whose efforts make this software what it is. These people have helped by writing code and documentation, and by testing. They have created and maintained this product, its associated libraries and applications, our build tools and our web sites.

#### Contributors

- Ackerley, Nick
- Allgeyer, Sebastien
- Ammon, Charles J.
- Antunes, Emanuel
- Arnarsson, Ólafur St.
- Bank, Markus
- Barsch, Robert
- Behr, Yannik
- Bernardi, Fabrizio
- Bernauer, Felix
- Bes de Berc, Maxime
- Beyreuther, Moritz
- Boltz, Shawn
- Bonaimé, Sébastien
- Carothers, Lloyd
- Chamberlain, Calum
- Chambers, Derrick
- Chen, Zhao
- Clark, Adam
- Danecek, Peter
- Egdorf, Sven
- Engels, Fabian
- Ermert, Laura
- Eulenfeld, Tom

- Fabbri, Tommaso
- Falco, Nicholas
- Fee, Jeremy
- Grellier, Clément
- Grunberg, Marc
- Hammer, Conny
- Heimann, Sebastian
- Heiniger, Lukas
- Hope, Gaute
- Igel, Heiner
- Inza, Adolfo
- Isken, Marius
- Ketchum, David
- Koymans, Mathijs
- Kremers, Simon
- Kress, Victor
- Krieger, Lars
- Krischer, Lion
- Kula, Damian
- Käufl, Paul
- Köhler, Andreas
- Lecocq, Thomas
- Leeman, John
- Legovini, Paride

- Lesage, Philippe
- Li, Yulin
- Lomax, Anthony
- Lopes, Rui L.
- MacCarthy, Jonathan
- Maggi, Alessia
- Martin, Henri
- Medlin, Andrew
- Megies, Tobias
- Meschede, Matthias
- Michelini, Alberto
- Miller, Nathaniel C.
- Morgenstern, Bernhard
- Nof, Ran Novitsky
- Panning, Mark P.
- Parker, Tom
- Pestourie, Romain
- Rapagnani, Giovanni
- Reyes, Celso
- Ringler, Adam
- Rothenhäusler, Nicolas
- Russo, Emiliano
- Sales de Andrade, Elliott

- Satriano, Claudio
- Saul, Joachim
- Scheingraber, Chris
- Schneider, Simon
- Sippl, Christian
- Snoke, Arthur
- Stange, Stefan
- Stähler, Simon C.
- Sullivan, Benjamin
- Tian, Dongdong
- Trabant, Chad
- Trani, Luca
- Uieda, Leonardo
- Walker, Andrew
- Walther, Marcus
- Wassermann, Joachim
- Williams, Mark C.
- Winkelman, Andrew
- Zaccarelli, Riccardo
- Zad, Seyed Kasra Hosseini
- Zhu, Lijun
- van Driel, Martin
- van Wijk, Kasper

#### Funds

ObsPy was partially funded by the

- German Science Foundation (DFG) via grant DFG IG 16/9-1
- German Ministry for Education and Research (BMBF), GEOTECHNOLOGIEN grant 03G0646H.
- NERA project (Network of European Research Infrastructures for Earthquake Risk Assessment and Mitigation) under the European Community's Seventh Framework Programme (FP7/2007-2013) grant agreement n° 262330
- Leibniz Institute for Applied Geophysics (LIAG)
- VERCE EU-FP7 project (no. 283543)