def obspy_3d_plot(inventory, catalog, size=(<NUM_LIT>, <NUM_LIT>), **kwargs):
nodes = []<EOL>for ev in catalog:<EOL><INDENT>nodes.append((ev.preferred_origin().latitude,<EOL>ev.preferred_origin().longitude,<EOL>ev.preferred_origin().depth / <NUM_LIT:1000>))<EOL><DEDENT>all_stas = []<EOL>for net in inventory:<EOL><INDENT>for sta in net:<EOL><INDENT>if len(sta.channels) > <NUM_LIT:0>:<EOL><INDENT>all_stas.append((sta.latitude, sta.longitude,<EOL>sta.elevation / <NUM_LIT:1000> -<EOL>sta.channels[<NUM_LIT:0>].depth / <NUM_LIT:1000>))<EOL><DEDENT>else:<EOL><INDENT>warnings.warn('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>all_stas.append((sta.latitude, sta.longitude,<EOL>sta.elevation / <NUM_LIT:1000>))<EOL><DEDENT><DEDENT><DEDENT>fig = threeD_seismplot(<EOL>stations=all_stas, nodes=nodes, size=size, **kwargs)<EOL>return fig<EOL>
Plot obspy Inventory and obspy Catalog classes in three dimensions.

:type inventory: obspy.core.inventory.inventory.Inventory
:param inventory: Obspy inventory class containing station metadata
:type catalog: obspy.core.event.catalog.Catalog
:param catalog: Obspy catalog class containing event metadata
:type save: bool
:param save: False will plot to screen, true will save plot and not show \
    to screen.
:type savefile: str
:param savefile: Filename to save to, required for save=True
:type size: tuple
:param size: Size of figure in inches.

:returns: :class:`matplotlib.figure.Figure`

.. rubric:: Example:

>>> from obspy.clients.fdsn import Client
>>> from obspy import UTCDateTime
>>> from eqcorrscan.utils.plotting import obspy_3d_plot
>>> client = Client('IRIS')
>>> t1 = UTCDateTime(2012, 3, 26)
>>> t2 = t1 + 86400
>>> catalog = client.get_events(starttime=t1, endtime=t2, latitude=-43,
...                             longitude=170, maxradius=5)
>>> inventory = client.get_stations(starttime=t1, endtime=t2, latitude=-43,
...                                 longitude=170, maxradius=10)
>>> obspy_3d_plot(inventory=inventory, catalog=catalog) # doctest: +SKIP

.. plot::

    from obspy.clients.fdsn import Client
    from obspy import UTCDateTime
    from eqcorrscan.utils.plotting import obspy_3d_plot
    client = Client('IRIS')
    t1 = UTCDateTime(2012, 3, 26)
    t2 = t1 + 86400
    catalog = client.get_events(starttime=t1, endtime=t2, latitude=-43,
                                longitude=170, maxradius=5)
    inventory = client.get_stations(starttime=t1, endtime=t2, latitude=-43,
                                    longitude=170, maxradius=10)
    obspy_3d_plot(inventory=inventory, catalog=catalog)