This type of plots are very common in our area of investigation. But to plot it is not so easy, first you have to split total DOS in partial atomic density. This require time and creativity, here we show some tips and tricks to acomplish this task. First we are going to show how to make a partial DOS, and then a multiplot of DOS's.
Partial DOS
You can skip the previus step and download the files here: doss_files.tar.gz
Now to plot the density of states create a new directory and copy the b3lyp_tio2.dat file to this directory. First column is the energy in Hartree, second are the total sum of states, the third are the Ti (d) contributions, and the fourth are the O (p) contributions.
Use the general gnuplot template and modify the data you want to plot, in this case we are plotting the total density of states, and the contribution by Ti (d) and O (p) orbitals.
You can download this gnuplot template here: doss_single.p. It will generate a png image.
#====================================================== # Standard initialization to create the plot # some tags are for latin-american speakers #====================================================== set termopt enhanced # Allows to put ^super/_{sub} indexes set autoscale # scale axes automatically unset log # remove any log-scaling unset label # remove any previous labels set xtic auto # set xtics automatically set ytic auto # set ytics automatically set encoding iso_8859_1 # Allow to put accents # SPECIFY PLOT RANGE #====================================================== set xr [-5.6:9.6] set xtics 1 set yr [0:20] # Output settings terminals #===================================================== # # Type of file you want to print the plot # eps is the most recomended # Default: Shows it on your screen set term pngcairo size 600,900 enhanced font "Times-New-Roman, 16" set output "doss_multiplot.png" #======================================================= # Plot instructions #======================================================= plot "b3lyp_tio2.dat" using (($1*27.21)+5.48):($4/27.21) title 'Total DOS' with filledcurve y1=0 ls 5 , \ "b3lyp_tio2.dat" using (($1*27.21)+5.48):($2/27.21) title 'Ti (p)' with lines ls 11 , \ "b3lyp_tio2.dat" using (($1*27.21)+5.48):($3/27.21) title 'O (d)' with lines ls 10;
Multiplot
The FAMAlab investigates the electronic properties of pure and doped materials, adsorbed molecules on material surfaces as well as using functional differens for descrive the elctronic properties. So making comparisons between different plots is very common.
In this section we show how to use the multiplot tool to put more than one graphic on the same canvas. For to make a multiplot is necessary create a new directory and copy all the .dat files to this directory.
Merge plots in a column
Lets merge the plots deleting the space between them. We have to unset x axis tics and x axis label of the second and third plot. As we do in merging plots in rows, we have to align them setting the y axis label but plotting the label outside canvas.
# Canvas size of each plot #===================================================== xsize= 0.95 # Controls the image x size in the canvas ysize= 0.265 # Controls the image y size in the canvas # Output settings terminals #===================================================== # # Type of file you want to print the plot # eps is the most recomended # Default: Shows it on your screen set term pngcairo size 600,900 enhanced font "Times-New-Roman, 16" set output "doss_multiplot.png" # Settings of multiplot #======================================================= set multiplot layout 3 ,1 columnsfirst title "Comparison between hybrid functionals" set xlabel 'Energy [eV]' #sets the x axis label set ylabel "Density of states [states/eV]" offset 1,0 #sets the y axis label set key at -0.5, 18 nobox # Location of the label box set xr [-5.8:10.5] # x ranges of plots set xtics 1 #Fine control of the major (labelled) tics on the x axis set yr [0:20] # x ranges of plots # First plot #======================================================= # Reset keys unset bmargin unset tmargin # Clears the past x possition unset label # Clears the past label unset xtics # Removes the x axis tics unset xlabel # Removes the x axis label # Setting individual keys set xlabel 'Energy [eV]' set ylabel "Density of states [states/eV]" offset 0.0,15 set size xsize, ysize # Plot size in relation with canvas set tmargin at screen 0.365 # Controls the y final position set bmargin at screen 0.10 # Controls the y initial position set label "TiO_{2} with B3LYP" at 4,18 plot "b3lyp_tio2.dat" using (($1*27.21)+5.48):($4/27.21) title 'Total DOS' with filledcurve y1=0 ls 5, \ "b3lyp_tio2.dat" using (($1*27.21)+5.48):($2/27.21) title 'Ti (p)' with lines ls 11, \ "b3lyp_tio2.dat" using (($1*27.21)+5.48):($3/27.21) title 'O (d)' with lines ls 10; pl.show()
You can download the multiplot template here: doss_multiplot.p. It will generate a png image.