def thermal_data(data, figsize=(12, 4), ms_data=50,
                 v_label='Unit-cell volume $(\mathrm{\AA}^3)$',
                 pdf_filen=None, title='P-V-T data'):
    """
    plot P-V-T data before fitting

    :param data: {'p': unumpy array, 'v': unumpy array, 'temp': unumpy array}
    :param eoscurves: {'v': unumpy array, '300': unumpy array
            at the temperature ....}
    :param v_label: label for volume axis
    :param figsize: figure size
    :param ms_data: marker size for data points
    :param pdf_filen: name of pdf output file
    :param title: title of the figure
    :return: None
    """
    # basic figure setup
    f, ax = plt.subplots(1, 2, figsize=figsize, sharex=True)

    # read data to plot
    if isuncertainties([data['p'], data['v'], data['temp']]):
        p = unp.nominal_values(data['p'])
        v = unp.nominal_values(data['v'])
        temp = unp.nominal_values(data['temp'])
        sp = unp.std_devs(data['p'])
        sv = unp.std_devs(data['v'])
        stemp = unp.std_devs(data['temp'])
        ax[0].errorbar(p, v, xerr=sp, yerr=sv, marker=' ',
                       c='k', ms=0, mew=0, linestyle='None',
                       capsize=0, lw=0.5, zorder=1)
        ax[1].errorbar(p, temp, xerr=sp, yerr=stemp, marker=' ',
                       c='k', ms=0, mew=0, linestyle='None',
                       capsize=0, lw=0.5, zorder=1)
    else:
        p = data['p']
        v = data['v']
        temp = data['temp']
    points = ax[0].scatter(p, v, marker='o', s=ms_data, c=temp,
                           cmap=c_map, vmin=300., vmax=temp.max(), zorder=2)
    points = ax[1].scatter(p, temp, marker='o', s=ms_data, c=temp,
                           cmap=c_map, vmin=300., vmax=temp.max(), zorder=2)

    ax[0].set_xlabel('Pressure (GPa)')
    ax[1].set_xlabel('Pressure (GPa)')
    ax[0].set_ylabel(v_label)
    ax[1].set_ylabel('Temperature (K)')
    f.suptitle(title)
    # the parameters are the specified position you set
    position = f.add_axes([0.92, 0.11, .01, 0.75])
    f.colorbar(points, orientation="vertical", cax=position)
    # position.text(150., 0.5, 'Temperature (K)', fontsize=10,
    # rotation=270, va='center')
    if pdf_filen is not None:
        f.savefig(pdf_filen)
def thermal_data ( data , figsize = ( 12 , 4 ) , ms_data = 50 , v_label = 'Unit-cell volume $(\mathrm{\AA}^3)$' , pdf_filen = None , title = 'P-V-T data' ) : f , ax = plt . subplots ( 1 , 2 , figsize = figsize , sharex = True ) if isuncertainties ( [ data [ 'p' ] , data [ 'v' ] , data [ 'temp' ] ] ) : p = unp . nominal_values ( data [ 'p' ] ) v = unp . nominal_values ( data [ 'v' ] ) temp = unp . nominal_values ( data [ 'temp' ] ) sp = unp . std_devs ( data [ 'p' ] ) sv = unp . std_devs ( data [ 'v' ] ) stemp = unp . std_devs ( data [ 'temp' ] ) ax [ 0 ] . errorbar ( p , v , xerr = sp , yerr = sv , marker = ' ' , c = 'k' , ms = 0 , mew = 0 , linestyle = 'None' , capsize = 0 , lw = 0.5 , zorder = 1 ) ax [ 1 ] . errorbar ( p , temp , xerr = sp , yerr = stemp , marker = ' ' , c = 'k' , ms = 0 , mew = 0 , linestyle = 'None' , capsize = 0 , lw = 0.5 , zorder = 1 ) else : p = data [ 'p' ] v = data [ 'v' ] temp = data [ 'temp' ] points = ax [ 0 ] . scatter ( p , v , marker = 'o' , s = ms_data , c = temp , cmap = c_map , vmin = 300. , vmax = temp . max ( ) , zorder = 2 ) points = ax [ 1 ] . scatter ( p , temp , marker = 'o' , s = ms_data , c = temp , cmap = c_map , vmin = 300. , vmax = temp . max ( ) , zorder = 2 ) ax [ 0 ] . set_xlabel ( 'Pressure (GPa)' ) ax [ 1 ] . set_xlabel ( 'Pressure (GPa)' ) ax [ 0 ] . set_ylabel ( v_label ) ax [ 1 ] . set_ylabel ( 'Temperature (K)' ) f . suptitle ( title ) position = f . add_axes ( [ 0.92 , 0.11 , .01 , 0.75 ] ) f . colorbar ( points , orientation = "vertical" , cax = position ) if pdf_filen is not None : f . savefig ( pdf_filen )
plot P-V-T data before fitting

    :param data: {'p': unumpy array, 'v': unumpy array, 'temp': unumpy array}
    :param eoscurves: {'v': unumpy array, '300': unumpy array
            at the temperature ....}
    :param v_label: label for volume axis
    :param figsize: figure size
    :param ms_data: marker size for data points
    :param pdf_filen: name of pdf output file
    :param title: title of the figure
    :return: None