TABLE OF CONTENTS


::pwtk::lobster::multiplot

SYNOPSIS

proc ::pwtk::lobster::multiplot {args} {

USAGE

   ::pwtk::lobster::multiplot  ?-dir DIR?  ?PLOTTING-OPTIONS?  ?STANDARD-PLOTTING-OPTIONS?  PROPERTY_INTERACTIONS_LLIST  ?HEAD?
    
   where PLOTTING-OPTIONS are:

      -xE
      -cohp+
      -int
      -sumspin
      -splitspin
      -fill   
      -dt_dw DASHTYPE
      -ft_dw TRANSPARENCY
      -nx NUMBER
      -np NUMBER
      -o  ORIENT

   For STANDARD-PLOTTING-OPTIONS, see: ::pwtk::plot

OPTION

PLOTTING OPTIONS

ARGUMENTS

DESCRIPTION

This command plots the LOBSTER-calculated data in a multiplot consisting of several plots. It usage is analogous to the ::pwtk::lobster::plot command, with two differences:

The PROPERTY_INTERACTION_LLIST is a list of PROPERTY_INTERACTIONS lists. Here is an example:

    set PROPERTY_INTERACTIONS_LLIST {
       { DOS   i0 }
       { COOP  {i0 (i1+i2+i3)/3.0} }
       { COHP  {i0 (i1+i2+i3)/3.0} }
    }

With such a specification, a multiplot with three plots would be created. The first plot contains the total DOS, the second plot two COOP curves, and the third plot two COHP curves with the first curve corresponding to 'i0' and the second to '(i1+i2+i3)/3.0'.

For further info, see ::pwtk::lobster::plot

EXAMPLE

    # plot total DOS and average COOP and COHP, each in a
    # separate plot arranged in a 3x1 matrix layout

    ::pwtk::lobster::multiplot -nx 3 -fill {
         { DOS  i0 }
         { COOP i0 }
         { COHP i0 }
    }

    # plot average and the first three individual interactions
    # for COOP, COHP, and COBI (each property in its own plot)

    ::pwtk::lobster::multiplot -nx 3 {
         { COOP {i0 i1 i2 i3} }
         { COHP {i0 i1 i2 i3} }
         { COBI {i0 i1 i2 i3} }
    }    

    # for atoms 1, 2 and atoms 3-5 (each in a separate plot),
    # plot atomic DOS and DOS projected to s and p orbitals
    # (atoms 1-5 are assumed to be of the same type; for atoms
    # 3-5, the average is plotted)   
    #
    # X-axis is used for the energy if -xE is specified

    ::pwtk::lobster::multiplot -nx 3 -xE {
         { DOS.orbatom1   {i0 i1 i2 i3 i4} }
         { DOS.orbatom2   {i0 i1 i2 i3 i4} }
         { DOS.orbatom3-5 {i0/3 i1/3 i2/3 i3/3 i4/3} }
    }

    # N.B. to learn about the meaning of iX strings, run in the PWTK prompt:  ::pwtk::lobster::datafy DOS
    # and look into the generated DOSCAR.orbatom1.dat file, i.e.:    
    #    i0 = sum
    #    i1 = 2s
    #    i2 = 2p_y
    #    i3 = 2p_z
    #    i4 = 2p_x

RETURN VALUE

Filename(s) of the created Gnuplot plot(s) (for file terminals) or the empty string (for window terminals).

SOURCE

    printTitle "Multiplotting LOBSTER data"

    set type multiplot
    set arg1 FILE_INTERACTION_LLIST
    xplotParseCmdline_

    ::pwtk::eval_in_dir $opt(dir) {        
        set nplot [llength $FILE_INTERACTION_LLIST]
        if { $opt(splitspin) } {
            set nspin [dict get [getinfo [lobsterfile_ [lindex [lindex $FILE_INTERACTION_LLIST 0] 0]]] nspin]
            set nplot [expr $nspin*$nplot]
        }
        set ax2 [expr { $opt(xE) ? "y2l" : "x2l" }]
        if { $opt(int) && $opt($ax2) eq {} } {
            set opt($ax2) "Integrated"
        }
        
        array set mp [::pwtk::gp::multiplot_array $nplot $opt(np) $opt(nx)]
        set font $::pwtk::gp::gp(font),[expr round(0.85*$mp(fsize))]

        set gp [::pwtk::gp::multiplot new -o $opt(o) -s $opt(s) auto $nplot $opt(np) $opt(nx) $head.$opt(t)]
        $gp cmdlineOpts opt
        $gp set key  "top left Left reverse samplen 1 noenhanced font '$font'"

        if { $opt(int) } {
            if { $opt(xE) } {
                $gp options { ytics nomirror y2tics { } }
            } else {
                $gp options { xtics nomirror x2tics { } }
            }
        }

        set fileL {}
        set datL  {}
        foreach fileInterL $FILE_INTERACTION_LLIST {
            set l [expr { $opt(xE) ? "yl" : "xl" }]
            set $l $opt($l)
            ifset $l [label_ [lindex $fileInterL 0] $opt(cohp+)]; # use the property from the first file

            $gp set ${l}abel [::pwtk::squote [varvalue $l]]
            
            if { ! $opt(splitspin) || $opt(sumspin) } {
                $gp plot [plot_ opt fileL datL $fileInterL]
            } else {
                $gp plot [plot_ opt fileL datL $fileInterL 0]
                $gp plot [plot_ opt fileL datL $fileInterL 1]
            }
        }
        set result [::pwtk::gp::execDisplay_ $gp opt]
    }    
    return $result
}