<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def plot_coordinates(network, pores=None, fig=None, **kwargs):
 r""" Produces a 3D plot showing specified pore coordinates as markers Parameters network : OpenPNM Network Object The network whose topological connections to plot pores : array_like (optional) The list of pores to plot if only a sub-sample is desired. This is useful for inspecting a small region of the network. If no pores are specified then all are shown. fig : Matplotlib figure handle If a ``fig`` is supplied, then the coordinates will be overlaid. This enables the plotting of multiple different sets of pores as well as throat connections from ``plot_connections``. kwargs : dict By also in different marker properties such as size (``s``) and color (``c``). For information on available marker style options, visit the Matplotlib documentation on the `web <http://matplotlib.org/api/lines_api.html#matplotlib.lines.Line2D>`_ Notes ----- The figure handle returned by this method can be passed into ``plot_topology`` to create a plot that combines pore coordinates and throat connections, and vice versa. See Also -------- plot_connections Examples -------- """

    import matplotlib.pyplot as plt
    from mpl_toolkits.mplot3d import Axes3D

    if pores is None:
        Ps = network.Ps
    else:
        Ps = network._parse_indices(indices=pores)

    if len(sp.unique(network['pore.coords'][:, 2])) == 1:
        ThreeD = False
    else:
        ThreeD = True

    if fig is None:
        fig = plt.figure()
        if ThreeD:
            ax = fig.add_subplot(111, projection='3d')
        else:
            ax = fig.add_subplot(111)
    else:
        ax = fig.gca()

    # Collect specified coordinates
    X = network['pore.coords'][Ps, 0]
    Y = network['pore.coords'][Ps, 1]
    Z = network['pore.coords'][Ps, 2]
    if ThreeD:
        _scale_3d_axes(ax=ax, X=X, Y=Y, Z=Z)

    if ThreeD:
        ax.scatter(xs=X, ys=Y, zs=Z, **kwargs)
    else:
        ax.scatter(X, Y, **kwargs)

    return fig