# Path: pyqha/eos.py
# def calculate_fitted_points(V,a):
#     """
#     Calculates a denser mesh of E(V) points (1000) for plotting.
#     """
#     Vstep = (V[len(V)-1]-V[0])/1000
#     Vdense = np.zeros(1000)
#     Edensefitted = np.zeros(1000)
#     for i in range(0,1000):
#         Vdense[i] = V[0] + Vstep*i 
#         Edensefitted[i] = E_Murn(Vdense[i],a)
#         
#     return Vdense, Edensefitted


    from matplotlib import use
from .eos import calculate_fitted_points
    from mpl_toolkits.mplot3d import axes3d
    from matplotlib import cm
    from .minutils import calculate_fitted_points_anis
    from .minutils import calculate_fitted_points_anis
import matplotlib.pyplot as plt
import numpy as np
            for i in range(0,len(y[0,:])):
                ax.plot(x, y[:,i], colors[i])
    else:
        try:    # try if there are multiple data on x axis
            for i in range(0,len(y[0,:])):
                ax.plot(x[:,i], y[:,i], colors[i],label=labels[i])
        except: # if not use a single x axis
            for i in range(0,len(y[0,:])):
                ax.plot(x, y[:,i], colors[i],label=labels[i])       
        ax.legend() 
        
    ax.set_xlabel(xlabel)
    ax.set_ylabel(ylabel)

    plt.show()
    
    return fig
    

def plot_EV(V,E,a=None,labely="Etot"):
    """
    This function plots with matplotlib E(V) data and if a is given it also plot
    the fitted results
    """
     
    fig = plt.figure()
    ax = fig.add_subplot(1, 1, 1)  # create an axes object in the figure
    
    ax.plot(V, E, 'o', label=labely+" data", markersize=10)
    if (a!=None):

# Path: pyqha/eos.py
# def calculate_fitted_points(V,a):
#     """
#     Calculates a denser mesh of E(V) points (1000) for plotting.
#     """
#     Vstep = (V[len(V)-1]-V[0])/1000
#     Vdense = np.zeros(1000)
#     Edensefitted = np.zeros(1000)
#     for i in range(0,1000):
#         Vdense[i] = V[0] + Vstep*i 
#         Edensefitted[i] = E_Murn(Vdense[i],a)
#         
#     return Vdense, Edensefitted


# Path: pyqha/plotutils.py
    from matplotlib import use
from .eos import calculate_fitted_points
    from mpl_toolkits.mplot3d import axes3d
    from matplotlib import cm
    from .minutils import calculate_fitted_points_anis
    from .minutils import calculate_fitted_points_anis
import matplotlib.pyplot as plt
import numpy as np

            for i in range(0,len(y[0,:])):
                ax.plot(x, y[:,i], colors[i])
    else:
        try:    # try if there are multiple data on x axis
            for i in range(0,len(y[0,:])):
                ax.plot(x[:,i], y[:,i], colors[i],label=labels[i])
        except: # if not use a single x axis
            for i in range(0,len(y[0,:])):
                ax.plot(x, y[:,i], colors[i],label=labels[i])       
        ax.legend() 
        
    ax.set_xlabel(xlabel)
    ax.set_ylabel(ylabel)

    plt.show()
    
    return fig
    

def plot_EV(V,E,a=None,labely="Etot"):
    """
    This function plots with matplotlib E(V) data and if a is given it also plot
    the fitted results
    """
     
    fig = plt.figure()
    ax = fig.add_subplot(1, 1, 1)  # create an axes object in the figure
    
    ax.plot(V, E, 'o', label=labely+" data", markersize=10)
    if (a!=None):

        Vdense, Edensefitted = calculate_fitted_points(V,a)