def plotConstraints(control, axis=None, show=True):
    """
    Plots constraints used for coil current control
    
    axis     - Specify the axis on which to plot
    show     - Call matplotlib.pyplot.show() before returning
    
    """
    import matplotlib.pyplot as plt
    if axis is None:
        fig = plt.figure()
        axis = fig.add_subplot(111)
    for r, z in control.xpoints:
        axis.plot(r, z, 'bx')
    if control.xpoints:
        axis.plot([], [], 'bx', label='X-point constraints')
    for r1, z1, r2, z2 in control.isoflux:
        axis.plot([r1, r2], [z1, z2], ':b^')
    if control.isoflux:
        axis.plot([], [], ':b^', label='Isoflux constraints')
    if show:
        plt.legend()
        plt.show()
    return axis
