TABLE OF CONTENTS
::pwtk::ldos_multiplot
SYNOPSIS
proc ::pwtk::ldos_multiplot {args} {
USAGE
ldos_multiplot ?-e E_FERMI|PWO_FILE? ?-xr XMIN:XMAX? ?-yr YMIN:YMAX? ?-yf YFORMAT? ?-lm LEFT_MARGIN? \ ?-nx NX? ?-np NP? ?-t TERM? ?-s PX,PY? ?-o ORIENT? ?-v? pdosFileLL head
DESCRIPTION
Visualize specified LDOSes as a "multiplot" with aid of Gnuplot.
ARGUMENTS
- pdosFileLL -- list of lists of projwfc.x PDOS files (or their sum generated with sumpdos.x)
- head -- head for the output generated $head.gp and $head.eps files
The structure of the pdosFileLL list-of-lists is the following:
set pdosFileLL { {pdosFile1 pdosFile2} {pdosFileX pdosFileY pdosFileZ} pdosFileW }
For each list element in pdosFileLL, a plot is generated. Hence, the number of generated plots is [llength $pdosFileLL]. For the above example, three LDOS plots are created. The 1st plot displays the LDOSes for pdosFile1 and pdosFile2, the 2nd plot displays the LDOSes for pdosFileX, pdosFileY, and pdosFileZ, etc.
OPTIONS
- -e EFERMI ... Fermi energy (either a floating-point number or a pw.x output file from where to grep the Fermi energy)
- -xr RANGE ... xrange for plots specified as XMIN:XMAX (where XMIN and XMAX are numbers)
- -yr RANGE ... yrange for plots specified as YMIN:YMAX
- -yf FORMAT ... format for the Y-axis numbers (in C syntax)
- -lm MARGIN ... left-margin for PDOS plots (more digits on Y-axis require wider left-margin)
- -nx NUMBER ... number of plots per row
- -np NUMBER ... number of plots per page
- -t TERM ... terminal to plot to (default = eps), possible terminals are those returned by ::pwtk::gp::pwtk_terminals (e.g., file-terminals: eps, pdf, svg, png; window-terminals: qt, wxt, x11).
- -s SX,SY ... terminal size specified as size-x,size-y; (default = 1200,800); ignored for EPS
- -o ORIENT ... page orientation for EPS (default = portrait); if -s is specified, this option is ignored
- -v ... visualize the generated image(s) (for file terminals)
Note that options are optional and any number of them can be specified.
RETURN VALUE
Filename of the created image (for file terminals) or the empty string (for window terminals).
SOURCE
set xdos LDOS set mode multi printTitle $xdos "Multiplot $xdos plotting" xdosParseOptions_ xdosGnuplotOptions_ # # make an LDOS plot for each list element in $pdosLL # set ith 0 set ipage 1 foreach pdosL $pdosLL { # # filledcurves # set lt 1 set plot {} foreach pdos $pdosL { set kres [pdos_kresolved $pdos] set spin [pdos_spin $pdos] set Ei [expr 1 + $kres] set Yi [expr 2 + $kres] append plot " '$pdos' u (\$$Ei-Efermi):(\$$Ei-Efermi <= 0.0 ? \$$Yi : 0/0) not w filledcurve y1=0.0 lt $lt, \\\n" if { $spin } { set Yi [expr 3 + $kres] append plot " '$pdos' u (\$$Ei-Efermi):(\$$Ei-Efermi <= 0.0 ? -\$$Yi : 0/0) not w filledcurve y1=0.0 lt $lt, \\\n" } incr lt } append plot " \\\n" # # lines # set lt 1 foreach pdos $pdosL { set kres [pdos_kresolved $pdos] set spin [pdos_spin $pdos] set Ei [expr 1 + $kres] set Yi [expr 2 + $kres] if { $lt > 1 } { append plot ", \\\n" } append plot " '$pdos' u (\$$Ei-Efermi):(\$$Yi) t '$pdos' w l lt $lt lw 2" if { $spin } { set Yi [expr 3 + $kres] append plot ", \\ '$pdos' u (\$$Ei-Efermi):(-\$$Yi) not w l lt $lt lw 2" } incr lt } $gp plot $plot } xdosExecGnuplot_ return $outputs }