#!/usr/bin/env python
# -*- coding: utf 8 -*-
"""
Initialize the library.

:copyright: 2015 - Geo2X - VM
:license: Apache 2.0
"""

import matplotlib.pyplot as plt

def _removeAxes(fig):
    """
    Remove all axes from current figure and return blank figure
    """
    axes = fig.get_axes()
    for a in axes:
        fig.delaxes(a)
    return fig
    
def verticalAxes(fig, n=2):
    """
    Add n vertically stacked axes on the selected figure
    
    Returns figure and ax list
    """
    fig = _removeAxes(fig)
    ax = []
    for i in range(n):
        ax.append( fig.add_subplot(n,1,i) )
    return fig, ax
    
def horizontalAxes(fig, n=2):
    """
    Add n horizontally stacked axes on the selected figure
    
    Returns figure and ax list
    """
    fig = _removeAxes(fig)
    ax = []
    for i in range(n):
        ax.append( fig.add_subplot(1,n,i) )
    return fig, ax