Beispiel #1
0
def main():
    # X = np.arange(10)
    # Y = np.sin(X / (2 * np.pi))
    # Z = Y ** 2.0
    X = Y = np.array(list(range(10)))
    Z = np.array(X**3)
    Z2 = np.array(X**4)
    gp.s([X, Y, Z, Z2])
    gp.c('splot "tmp.dat" using 1:2:3 with lines')
    gp.c('replot "tmp.dat" u 1:2:4 w lines')
    # gp.c('splot "tmp.dat" using 1:2:3:($3+$4) with zerrorfill')
    # gp.c('replot "tmp.dat" u 1:3 w lp')
    gp.p('myfigure.ps')
def Data_compare_Fig2(Properties, data, name):
    TYPE1 = "VASP-" + data
    TYPE2 = "ATOM-" + data
    TYPE3 = "VASP-" + "WAV-CAL"

    plot_command1 = "plot " + '"VASP_' + data + '" ' + 'u 1:2 w p pt 3 lw 1.2 title "' + TYPE1 + '"'
    plot_command2 = "replot " + '"ATOM_' + data + '" ' + 'u 1:2 w l lt 5 lw 1.8 title "' + TYPE2 + '"'
    plot_command3 = "replot " + '"VASP_' + data + '" ' + 'u 1:3 w l lt 7 lw 1.8 title "' + TYPE3 + '"'
    #    print(plot_command_VASP)
    #    exit ()
    Fig_title = "set title " + '"' + name + '"'
    Fig_name = name + ".eps"

    gp.c(Fig_title)
    gp.c('set xrange[0:3.0]')
    if (Properties == "waefunction"):
        gp.c('set yrange[-1:1.5]')
    elif (Properties == "wpsfunction"):
        gp.c('set yrange[-0.5:1.5]')
    elif (Properties == "density" and data == "PCORE"):
        gp.c('set yrange[0:1]')
    elif (Properties == "density" and data == "CORE"):
        gp.c('set yrange[0:9]')
    elif (Properties == "potential" and data == "POTAE"):
        gp.c('set yrange[-50: 100]')
    elif (Properties == "potential" and data == "POTPS"):
        gp.c('set yrange[-50: 20]')


#    elif (Properties == "potential" and data1 == "POTAE" and data2 == "POTPS"):
#       gp.c('set yrange[-50: 100]')
#    elif (Properties == "potential" and data1 == "POTAEC" and data2 == "POTPSC"):
#       gp.c('set yrange[-500: 50]')
    else:
        #       gp.c('set yrange[-50:250]')
        gp.c('set yrange[0:4]')
    gp.c(plot_command1)
    gp.c(plot_command2)
    gp.c(plot_command3)
    # gp.c('plot "VASP_WAE" u 1:2 w p pt 3 ps 2 title "VASP-AE"')
    # gp.c(plot_command_ATOM)
    # gp.p('myfigure.ps')
    gp.p(Fig_name)
def Data_Fig(Properties, type, data, name):
    TYPE = type + "-" + data
    #    TYPE2 = "ATOM-"+type

    plot_command1 = "plot " + '"' + type + '_' + data + '" ' + 'u 1:2 w p pt 3 ps 1.2 title "' + TYPE + '"'
    plot_command2 = "replot " + '"' + type + '_' + data + '" ' + 'u 1:3 w l lt 5 lw 1.2 title "' + TYPE + '"'
    #    plot_command_ATOM = "replot "+'"ATOM_'+data +'" '+'u 1:2 w l lt 5 lw 1.8 title "'+TYPE2+'"'
    #    print(plot_command_VASP)
    #    exit ()
    Fig_title = "set title " + '"' + data + '"'
    Fig_name = type + "_" + name + ".eps"

    gp.c(Fig_title)
    if (Properties == "wavefunction"):
        gp.c('set xrange[0:1.5]')
        gp.c('set yrange[-1.5:1.5]')

    gp.c(plot_command1)
    gp.c(plot_command2)
    # gp.c('plot "VASP_WAE" u 1:2 w p pt 3 ps 2 title "VASP-AE"')
    # gp.c(plot_command_ATOM)
    # gp.p('myfigure.ps')
    gp.p(Fig_name)
Beispiel #4
0
import PyGnuplot as gp
import numpy as np
X = np.arange(10)
Y = np.sin(X / (2 * np.pi))
Z = Y**2.0
gp.s([X, Y, Z])
gp.c('plot "tmp.dat" u 1:2 w l')
gp.c('replot "tmp.dat" u 1:3 w l')
gp.p('myfigure.ps')