Graphical representation of XPS Data

Germain Salvato Vallverdu germain.vallverdu@univ-pau.fr

This notebook shows how make a graphical representation of a series of XPS data experiments with python using pandas and matplotlib library.

  • Data are read from a vms file
  • Data are plotted against Binding Energy (BE)

If you are only interested in examples, jump to section Examples

This module, relies on matplotlib, panda and numpy modules.


In [1]:
%pylab --no-import-all inline
import re
import pandas as pd
import os


Populating the interactive namespace from numpy and matplotlib

Overview of the data file


In [2]:
ls *TXT


report1.TXT  report2.TXT

In [3]:
!head report1.TXT


/home/user/work/kalpha/compounds/data.vms
C1s Scan
	Characteristic Energy eV	1486.68	Acquisition Time s	2.5
KE_C1s Scan	BE_C1s Scan	CPS_C1s Scan	C 1s_1_C1s Scan	C 1s_2_C1s Scan	C 1s_3_C1s Scan	C 1s_4_C1s Scan	C 1s_5_C1s Scan	C 1s_6_C1s Scan	C1s_7_C1s Scan	Background_C1s Scan	Envelope_C1s Scan
1188.6	298.08	1007.68	1007.68	1007.68	1007.68	1007.68	1007.68	1007.68	1007.68	1007.68	1007.68
1188.7	297.98	968.728	968.728	968.728	968.728	968.728	968.728	968.728	968.728	968.728	968.728
1188.8	297.88	996.008	996.008	996.008	996.008	996.008	996.008	996.008	996.008	996.008	996.008
1188.9	297.78	976.144	976.144	976.144	976.144	976.144	976.144	976.144	976.144	976.144	976.144
1189	297.68	971.276	971.276	971.276	971.276	971.276	971.276	971.276	971.276	971.276	971.276
1189.1	297.58	960.176	960.176	960.176	960.176	960.176	960.176	960.176	960.176	960.176	960.176

In [4]:
with open("report1.TXT", "r") as f:
    for i in range(4):
        print("line {} = ".format(i), f.readline())


line 0 =  /home/user/work/kalpha/compounds/data.vms

line 1 =  C1s Scan

line 2 =  	Characteristic Energy eV	1486.68	Acquisition Time s	2.5

line 3 =  KE_C1s Scan	BE_C1s Scan	CPS_C1s Scan	C 1s_1_C1s Scan	C 1s_2_C1s Scan	C 1s_3_C1s Scan	C 1s_4_C1s Scan	C 1s_5_C1s Scan	C 1s_6_C1s Scan	C1s_7_C1s Scan	Background_C1s Scan	Envelope_C1s Scan

Ckeck that we can unpack data on a line


In [5]:
with open("report1.TXT", "r") as f:
    lines = f.readlines()
print(lines[3].split("\t"))


['KE_C1s Scan', 'BE_C1s Scan', 'CPS_C1s Scan', 'C 1s_1_C1s Scan', 'C 1s_2_C1s Scan', 'C 1s_3_C1s Scan', 'C 1s_4_C1s Scan', 'C 1s_5_C1s Scan', 'C 1s_6_C1s Scan', 'C1s_7_C1s Scan', 'Background_C1s Scan', 'Envelope_C1s Scan\n']

In [6]:
with open("report1.TXT", "r") as f:
    lines = f.readlines()
print(lines[4].split())


['1188.6', '298.08', '1007.68', '1007.68', '1007.68', '1007.68', '1007.68', '1007.68', '1007.68', '1007.68', '1007.68', '1007.68']

Classes and Functions

Skip this part if you are a user and jump to the Examples section. This part contains the source code in order to read, manage and plot the data.


In [7]:
# plot parameters
font = {'family': 'serif', 'size': 20}
plt.rc('font', **font)

SIZE = (12, 8)
XLABEL = "Bindig Energy (eV)"
YLABEL = "CPS"
GRID = False
LINEWIDTH = 2
ALPHA = .5
COLORS = ["black", "red", "green", "blue", "violet", "orange", 
          "cyan", "magenta", "indigo", "maroon", "turquoise" ]
# COLORS = ["#cc0000", "#3465a4",  "#f57900", "#c17d11", "#73d216", "#edd400", "#75507b"]
# COLORS = ["black", "blue", "#f57900", "(.0, .6, .0)", "red"]

class XPSData(object):
    """ Manage XPS Data """
    
    def __init__(self, filename, data, title, path=None, source=-1):
        """ 
        Build the object. Use this method only if you really know what you are 
        doing.
        A better choice is to use XPSData.from_file() method.
        """
        self.data = data
        self.title = title
        self.path = path
        self.source = source
        self.filename = filename
        self._to_plot = []

    def list_columns(self):
        """ print names of component in data """
        [print(c) for c in self.data.columns]
        
    def set_columns_to_plot(self, *args):
        """ Set names of the columns to be present on the plot """
        for arg in args:
            if arg not in self.data.columns:
                raise NameError("'{}' is not an existing column. ".format(arg) +
                                "Try list_columns()")
        self._to_plot = args

    def set_column_name(self, oldname, newname):
        """
        Rename column `oldname` of pandas table with name `newname`
        
        Args:
            oldname (str): name of the existing column
            newname (str): new name of the column
        """
        if oldname not in self.data.columns:
            raise NameError("'{}' is not an existing column. ".format(oldname) +
                            "Try list_columns()")
        else:
            self.data.rename(columns={oldname: newname}, inplace=True)

    def set_column_names_interac(self):
        """ Rename column name interactively """
        print("Enter the new column name if needed or return:")
        for c in self.data.columns:
            newname = input("{} => ".format(c))
            if newname.strip() != "":
                self.set_column_name(c, newname)
    
    def set_all_column_names(self, *args):
        """ 
        Rename all columns in one shot. You must give a name for 
        all columns. If you give "", the column name is not changed.
        """
        if len(args) != len(self.data.columns):
            raise ValueError("You must give all columns name.\n" +
                             "There are {} columns.\n".format(len(self.data.columns)) +
                             "You gave : {}".format(args))
        for new, old in zip(args, self.data.columns):
            if new != "":
                self.set_column_name(old, new)

    def get_plot(self, columns=None, fill=False, ax=None, xaxes=True, legend=True, fname=True):
        """
        Return a matplotlib plot of XPS data for the specified columns.
        
        Args:
            columns: list of column names to plot
            fill: if True, component are filled
            ax: the current instance of a matplotlib Axes
            xaxes: if True, the xaxis is drawn
            legend: if True, the legend is present
            fname: if True, the name of the data file is written
        """
        if columns:
            for c in columns:
                if c not in self.data.columns:
                    raise NameError("'{}' is not an existing column. ".format(c) +
                                    "Try list_names()")
        elif self._to_plot:
            columns = self._to_plot
        else:
            columns = self.data.columns
        
        if not ax:
            fig = plt.figure(figsize=SIZE)
            ax = fig.add_subplot(111)
            
        for i, col in enumerate(columns):
            color = COLORS[i % len(COLORS)]
            if fill and "BG" in self.data.columns and col != "Exp":
                ax.fill_between(self.data.index, self.data.BG, self.data[col], 
                                 alpha=ALPHA, color=color)
            ax.plot(self.data.index, self.data[col], linewidth=LINEWIDTH, 
                    c=color, label=col)

        # plot options :
        #   * remove frame
        #   * remove y axis
        #   * draw x axes
        ax.set_frame_on(False)
        if fname:
            ax.set_yticks([])
            ax.set_ylabel(self.filename, fontsize=10)
        else:
            ax.get_yaxis().set_visible(False)
        ax.grid(GRID)
        ax.set_xlim((self.data.index.min(), self.data.index.max()))
        if xaxes:
            ymin, ymax = ax.get_ylim()
            xmin, xmax = ax.get_xlim()
            ax.set_xlabel(XLABEL)
            ax.get_xaxis().tick_bottom() 
            ax.add_line(matplotlib.lines.Line2D((xmin, xmax), (ymin, ymin), 
                                                color="black", linewidth=5.))
        else:
            ax.get_xaxis().set_visible(False)

        if legend:
            ax.legend()
            
        return ax

    def save_plot(self, filename="plot.pdf", columns=None, fill=False, legend=True, fname=True):
        """
        Save matplotlib plot to a file.

        Args:
            filename: Filename to write to.
            columns: list of column names to plot
            fill: if True, component are filled
            legend: if True, the legend is present
            fname: if True, the file name of the data is written
        """
        ax = self.get_plot(columns=columns, fill=fill, legend=legend, fname=fname)
        plt.savefig(filename)
        
    @staticmethod
    def from_file(filename):
        """ return a XPSData object from a vms file extracted from CasaXPS. """
        # read the header
        with open(filename, "r") as f:
            path = f.readline().strip()
            title = f.readline().strip()
            source = float(re.findall("(\d+.\d+)", f.readline())[0])
            header = f.readline().split("\t")
        
        # read data
        num_data = np.loadtxt(filename, skiprows=4, dtype=np.float64)
        
        # build pandas table
        ndata = len(header)
        index = num_data[:,1]
        data = num_data[:, [0] + list(range(2, ndata))]
        columns = ["KE", "Exp"] 
        columns += ["Comp_{}".format(i-2) for i in list(range(3, ndata - 2))]
        columns += ["BG", "envelope"]
        
        data_frame = pd.DataFrame(data=data, index=index, columns=columns)
        
        return XPSData(filename, data_frame, title, path, source)

    def __str__(self):
        line = "filename : {}\n".format(self.filename)
        line += "path     : {}\n".format(self.path)
        line += "title    : {}\n".format(self.title)
        line += "source   : {} eV\n".format(self.source)
        line += "columns  : {}\n".format(" ; ".join(self.data.columns))
        return line 

class StackedXPSData(object):
    """ Merge several XPSData on one plot """
    
    def __init__(self, *args):
        """ 
        Build the object form a list of path to files which contains the XPS
        data needed to do the plot. The file are assume to be in vms format.
        
        data = StackedXPSData("data1.vms", "data2.vms"[, ...])
        """
        for arg in args:
            if not os.path.exists(arg):
                raise FileNotFoundError("No such file or directory {}".format(arg))
        self.filenames = args
        self.xpsData = [XPSData.from_file(arg) for arg in args]
        self.title = self.xpsData[0].title
        self._to_plot = []

    def set_columns_to_plot(self, *args):
        """ Set names of the columns to be present on the plot """
        self._to_plot = args
        
    def list_columns(self):
        """ List all column names """
        for xps in self.xpsData:
            print("{} : {}".format(xps.title, xps.filename))
            print(40 * "-")
            print(" ; ".join([c for c in xps.data.columns]) + "\n")
                    
    def set_column_name(self, oldname, newname):
        """
        Change the name of the column oldname in newname for all data.
        """
        for xpsData in self.xpsData:
            xpsData.set_column_name(oldname, newname)        
    
    def set_all_column_names(self, *args):
        """ 
        Rename all columns in one shot. You must give a name for 
        all columns.
        """
        for xpsData in self.xpsData:
            xpsData.set_all_column_names(*args)

    def set_column_names_interac(self):
        """ 
        Rename column name interactively, assume all XPSData have got the same
        column names.
        """
        print("Enter the new column name if needed or return:")
        for c in self.xpsData[0].data.columns:
            newname = input("{} => ".format(c))
            if newname.strip() != "":
                self.set_column_name(c, newname)

    def get_plot(self, columns=None, fill=False, legend=True, fname=True, pos=[]):
        """
        Return a matplotlib plot of all XPS data for the specified columns.
        XPS data are stacked with the first file at the top and the last
        file at the bottom.
        
        Args:
            columns: list of column names to plot
            fill: if True, component are filled
            legend: if True, the legend is present
            fname: if True, the name of the data file is written
            pos: list of x position of vertical lines
        """
        if self._to_plot:
            columns = self._to_plot
            
        # make subplots
        fig, axis = plt.subplots(len(self.xpsData), sharex=True, sharey=True)
        fig.set_size_inches(SIZE[1], SIZE[0])
        fig.subplots_adjust(hspace=0)

        for axes, xps in zip(axis[:-1], self.xpsData[:-1]):
            xps.get_plot(columns, fill, ax=axes, xaxes=False, legend=False, fname=fname)
        self.xpsData[-1].get_plot(columns, fill, ax=axis[-1], legend=False, fname=fname)

        # the legend
        if legend:
            axis[0].legend(bbox_to_anchor=(1.05, 0), loc='lower left', borderaxespad=0.)
        
        fig.suptitle(self.title)
        
        for p in pos:
            ymin = -(len(self.xpsData) - 1)
            axis[0].axvline(x=p, ymin=-(len(self.xpsData) - 1), ymax=1.1, c="#555753", 
                            linewidth=2, clip_on=False)
            ymin, ymax = axis[0].get_ylim()
            axis[0].text(x=p, y=1.15 * ymax, s="{:5.1f}".format(p), fontsize=12,
                        horizontalalignment='center')
            

        return fig

    def save_plot(self, filename="plot.pdf", columns=None, fill=False, legend=True, fname=True, pos=[]):
        """
        Save matplotlib plot to a file.

        Args:
            filename: Filename to write to.
            columns: list of column names to plot
            fill: if True, component are filled
            fname: if True, the name of the data file is written
            pos: list of x position of vertical lines
        """
        ax = self.get_plot(columns, fill, legend, fname, pos)
        plt.savefig(filename)

    def __str__(self):
        line = self.title + "\n" + 30 * "-" + "\n"
        line += "\n".join([str(xps) for xps in self.xpsData])
        return line

Save module

Examples

First we manage one set of XPS data, then we will see how to merge a series of datas.

The XPSData object

Loading data

Load the data file and print header informations :


In [8]:
report1 = XPSData.from_file("report1.TXT")

In [9]:
print(report1)


filename : report1.TXT
path     : /home/user/work/kalpha/compounds/data.vms
title    : C1s Scan
source   : 1486.68 eV
columns  : KE ; Exp ; Comp_1 ; Comp_2 ; Comp_3 ; Comp_4 ; Comp_5 ; Comp_6 ; Comp_7 ; BG ; envelope


In [10]:
print("filename :", report1.filename)
print("path     :", report1.path)
print("title    :", report1.title)
print("source   :", report1.source)


filename : report1.TXT
path     : /home/user/work/kalpha/compounds/data.vms
title    : C1s Scan
source   : 1486.68

Names of data columns

Manage the names of columns of the data


In [11]:
report1.list_columns()


KE
Exp
Comp_1
Comp_2
Comp_3
Comp_4
Comp_5
Comp_6
Comp_7
BG
envelope

In [12]:
report1.set_column_name("Comp_3", "carbonyle")
report1.list_columns()


KE
Exp
Comp_1
Comp_2
carbonyle
Comp_4
Comp_5
Comp_6
Comp_7
BG
envelope

You can set all columns names in one shot or do it interactively with set_column_names_interac(). Here is an example with all columns. If you don't want to change the name, just say "".


In [13]:
report1.set_all_column_names("", "", "carb", "", "", "tata", "toto", "titi", "tutu", "", "")
report1.list_columns()


KE
Exp
carb
Comp_2
carbonyle
tata
toto
titi
tutu
BG
envelope

See the data

Print the data as a table. You can also export the data in several format : excel, csv or latex table among other.


In [14]:
report1.data


Out[14]:
KE Exp carb Comp_2 carbonyle tata toto titi tutu BG envelope
298.08 1188.6 1007.680 1007.680 1007.680 1007.680 1007.680 1007.680 1007.680 1007.680 1007.680 1007.680
297.98 1188.7 968.728 968.728 968.728 968.728 968.728 968.728 968.728 968.728 968.728 968.728
297.88 1188.8 996.008 996.008 996.008 996.008 996.008 996.008 996.008 996.008 996.008 996.008
297.78 1188.9 976.144 976.144 976.144 976.144 976.144 976.144 976.144 976.144 976.144 976.144
297.68 1189.0 971.276 971.276 971.276 971.276 971.276 971.276 971.276 971.276 971.276 971.276
297.58 1189.1 960.176 960.176 960.176 960.176 960.176 960.176 960.176 960.176 960.176 960.176
297.48 1189.2 961.012 961.012 961.012 961.012 961.012 961.012 961.012 961.012 961.012 961.012
297.38 1189.3 986.828 986.828 986.828 986.828 986.828 986.828 986.828 986.828 986.828 986.828
297.28 1189.4 940.696 940.696 940.696 940.696 940.696 940.696 940.696 940.696 940.696 940.696
297.18 1189.5 999.648 999.648 999.648 999.648 999.648 999.648 999.648 999.648 999.648 999.648
297.08 1189.6 933.072 933.072 933.072 933.072 933.072 933.072 933.072 933.072 933.072 933.072
296.98 1189.7 930.280 930.280 930.280 930.280 930.280 930.280 930.280 930.280 930.280 930.280
296.88 1189.8 929.928 929.928 929.928 929.928 929.928 929.928 929.928 929.928 929.928 929.928
296.78 1189.9 930.900 930.900 930.900 930.900 930.900 930.900 930.900 930.900 930.900 930.900
296.68 1190.0 908.248 908.248 908.248 908.248 908.248 908.248 908.248 908.248 908.248 908.248
296.58 1190.1 945.936 945.936 945.936 945.936 945.936 945.936 945.936 945.936 945.936 945.936
296.48 1190.2 938.048 938.048 938.048 938.048 938.048 938.048 938.048 938.048 938.048 938.048
296.38 1190.3 908.576 908.576 908.576 908.576 908.576 908.576 908.576 908.576 908.576 908.576
296.28 1190.4 916.364 916.364 916.364 916.364 916.364 916.364 916.364 916.364 916.364 916.364
296.18 1190.5 928.108 928.108 928.108 928.108 928.108 928.108 928.108 928.108 928.108 928.108
296.08 1190.6 916.412 916.412 916.412 916.412 916.412 916.412 916.412 916.412 916.412 916.412
295.98 1190.7 956.672 956.672 956.672 956.672 956.672 956.672 956.672 956.672 956.672 956.672
295.88 1190.8 912.524 912.524 912.524 912.524 912.524 912.524 912.524 912.524 912.524 912.524
295.78 1190.9 968.040 968.040 968.040 968.040 968.040 968.040 968.040 968.040 968.040 968.040
295.68 1191.0 915.548 915.548 915.548 915.548 915.548 915.548 915.548 915.548 915.548 915.548
295.58 1191.1 959.756 959.756 959.756 959.756 959.756 959.756 959.756 959.756 959.756 959.756
295.48 1191.2 899.236 899.236 899.236 899.236 899.236 899.236 899.236 899.236 899.236 899.236
295.38 1191.3 953.908 953.908 953.908 953.908 953.908 953.908 953.908 953.908 953.908 953.908
295.28 1191.4 971.960 971.960 971.960 971.960 971.960 971.960 971.960 971.960 971.960 971.960
295.18 1191.5 944.488 944.488 944.488 944.488 944.488 944.488 944.488 944.488 944.488 944.488
... ... ... ... ... ... ... ... ... ... ... ...
281.98 1204.7 525.752 479.932 479.933 479.932 480.014 479.932 480.540 479.932 479.932 480.621
281.88 1204.8 541.252 479.792 479.792 479.792 479.836 479.792 480.083 479.792 479.792 480.127
281.78 1204.9 530.696 479.675 479.675 479.675 479.698 479.675 479.810 479.675 479.675 479.833
281.68 1205.0 510.168 479.605 479.605 479.605 479.617 479.605 479.665 479.605 479.605 479.678
281.58 1205.1 529.804 479.490 479.490 479.490 479.496 479.490 479.516 479.490 479.490 479.522
281.48 1205.2 492.360 479.460 479.460 479.460 479.463 479.460 479.471 479.460 479.460 479.474
281.38 1205.3 509.172 479.392 479.392 479.392 479.393 479.392 479.396 479.392 479.392 479.398
281.28 1205.4 500.268 479.344 479.344 479.344 479.345 479.344 479.346 479.344 479.344 479.346
281.18 1205.5 507.840 479.278 479.278 479.278 479.279 479.278 479.279 479.278 479.278 479.280
281.08 1205.6 479.920 479.277 479.277 479.277 479.277 479.277 479.277 479.277 479.277 479.277
280.98 1205.7 484.464 479.265 479.265 479.265 479.265 479.265 479.265 479.265 479.265 479.265
280.88 1205.8 488.580 479.244 479.244 479.244 479.244 479.244 479.244 479.244 479.244 479.244
280.78 1205.9 491.800 479.215 479.215 479.215 479.215 479.215 479.215 479.215 479.215 479.215
280.68 1206.0 476.124 479.208 479.208 479.208 479.208 479.208 479.208 479.208 479.208 479.208
280.58 1206.1 484.332 479.196 479.196 479.196 479.196 479.196 479.196 479.196 479.196 479.196
280.48 1206.2 503.040 479.141 479.141 479.141 479.141 479.141 479.141 479.141 479.141 479.141
280.38 1206.3 450.052 450.052 450.052 450.052 450.052 450.052 450.052 450.052 450.052 450.052
280.28 1206.4 475.452 475.452 475.452 475.452 475.452 475.452 475.452 475.452 475.452 475.452
280.18 1206.5 479.792 479.792 479.792 479.792 479.792 479.792 479.792 479.792 479.792 479.792
280.08 1206.6 464.372 464.372 464.372 464.372 464.372 464.372 464.372 464.372 464.372 464.372
279.98 1206.7 462.512 462.512 462.512 462.512 462.512 462.512 462.512 462.512 462.512 462.512
279.88 1206.8 446.224 446.224 446.224 446.224 446.224 446.224 446.224 446.224 446.224 446.224
279.78 1206.9 481.324 481.324 481.324 481.324 481.324 481.324 481.324 481.324 481.324 481.324
279.68 1207.0 472.880 472.880 472.880 472.880 472.880 472.880 472.880 472.880 472.880 472.880
279.58 1207.1 477.088 477.088 477.088 477.088 477.088 477.088 477.088 477.088 477.088 477.088
279.48 1207.2 434.572 434.572 434.572 434.572 434.572 434.572 434.572 434.572 434.572 434.572
279.38 1207.3 447.732 447.732 447.732 447.732 447.732 447.732 447.732 447.732 447.732 447.732
279.28 1207.4 461.808 461.808 461.808 461.808 461.808 461.808 461.808 461.808 461.808 461.808
279.18 1207.5 476.520 476.520 476.520 476.520 476.520 476.520 476.520 476.520 476.520 476.520
279.08 1207.6 446.332 446.332 446.332 446.332 446.332 446.332 446.332 446.332 446.332 446.332

191 rows × 11 columns

Just some statistical informations :


In [15]:
report1.data.describe()


Out[15]:
KE Exp carb Comp_2 carbonyle tata toto titi tutu BG envelope
count 191.00000 191.000000 191.000000 191.000000 191.000000 191.000000 191.000000 191.000000 191.000000 191.000000 191.000000
mean 1198.10000 2062.701351 1113.731848 1090.730277 1090.729257 957.685393 874.581325 828.246340 835.870723 789.863649 2052.392581
std 5.52811 2064.543500 1460.756378 831.086057 886.603473 467.876847 318.160434 201.844357 266.497844 215.153469 2070.421570
min 1188.60000 434.572000 434.572000 434.572000 434.572000 434.572000 434.572000 434.572000 434.572000 434.572000 434.572000
25% 1193.35000 915.956000 714.863500 499.860500 493.444000 821.434000 493.576500 700.684000 493.444000 493.444000 916.388000
50% 1198.10000 1131.420000 908.248000 942.270000 903.027000 928.108000 931.283000 902.823000 938.048000 892.421000 1073.070000
75% 1202.85000 2853.885000 994.039500 1031.280000 1036.850000 1015.525000 1021.455000 973.860000 1013.400000 964.585000 2909.500000
max 1207.60000 12516.300000 10836.600000 4303.490000 4413.630000 2782.820000 1776.520000 1164.350000 1442.760000 1041.360000 12514.500000

Get a plot of the data


In [16]:
report1.get_plot()


Out[16]:
<matplotlib.axes._subplots.AxesSubplot at 0x7faa1a4ef940>

You can select specific columns and fillin component.


In [17]:
report1.get_plot(columns=["Exp", "carb", "titi", "tutu"], fill=True, fname=False)


Out[17]:
<matplotlib.axes._subplots.AxesSubplot at 0x7faa1a44bf28>

The StackedXPSData object

Now, we will deal with several XPS data. This class is excpected to work for several vms file with allways the same number of columns.


In [18]:
stuff = StackedXPSData("report1.TXT", "report2.TXT", "report2.TXT")
print(stuff)


C1s Scan
------------------------------
filename : report1.TXT
path     : /home/user/work/kalpha/compounds/data.vms
title    : C1s Scan
source   : 1486.68 eV
columns  : KE ; Exp ; Comp_1 ; Comp_2 ; Comp_3 ; Comp_4 ; Comp_5 ; Comp_6 ; Comp_7 ; BG ; envelope

filename : report2.TXT
path     : /home/user/work/kalpha/compounds/data2.vms
title    : C1s Scan
source   : 1486.68 eV
columns  : KE ; Exp ; Comp_1 ; Comp_2 ; Comp_3 ; Comp_4 ; Comp_5 ; Comp_6 ; Comp_7 ; BG ; envelope

filename : report2.TXT
path     : /home/user/work/kalpha/compounds/data2.vms
title    : C1s Scan
source   : 1486.68 eV
columns  : KE ; Exp ; Comp_1 ; Comp_2 ; Comp_3 ; Comp_4 ; Comp_5 ; Comp_6 ; Comp_7 ; BG ; envelope


In [19]:
stuff.title = "C1s of a nice surface"

In [20]:
stuff.set_all_column_names("", "", "carb", "", "", "tata", "toto", "titi", "tutu", "", "")
stuff.list_columns()


C1s Scan : report1.TXT
----------------------------------------
KE ; Exp ; carb ; Comp_2 ; Comp_3 ; tata ; toto ; titi ; tutu ; BG ; envelope

C1s Scan : report2.TXT
----------------------------------------
KE ; Exp ; carb ; Comp_2 ; Comp_3 ; tata ; toto ; titi ; tutu ; BG ; envelope

C1s Scan : report2.TXT
----------------------------------------
KE ; Exp ; carb ; Comp_2 ; Comp_3 ; tata ; toto ; titi ; tutu ; BG ; envelope


In [21]:
fig = stuff.get_plot()



In [22]:
fig = stuff.get_plot(columns=["Exp", "carb", "titi", "tutu"])



In [23]:
fig = stuff.get_plot(columns=["Exp", "carb", "titi", "tutu"], fill=True, pos=[284.5, 290.9, 286.5])