コード例 #1
0
from splot.splot import data_dict, Splot, bgcolor

# plot axis setup: a single water fall plot
myplot = Splot()

for i in range (11):
    #load data: only the measured data will be plotted in this example,
    dataPath = "data/3/"+str(i*10)
    G = data_dict(dataPath, samplename ='Ag', scan = str(i*10))
    
    #plot data: y offset is 0.5 unit below to the above curve 
    myplot.plot_data(**G, scal=1, offsety = i*-1)

# Always configure the plot at the last step 
# Optional: add a title and change the label (the configuration here is ugly 
#                                    just for the purpose of showing an example)
# myplot.config(title="G(r) Plot", title_math = False,
#              x='r', xunit='nm', y='G', yunit='nm^(-2)', label_math=False)
myplot.config(context='manu')

# See the figure
myplot.show()
# Save figure
myplot.save(name = "Example_3_WaterfallMeas", form = "pdf")
コード例 #2
0
from splot.splot import data_dict, Splot

#plot axis setup: 1 rows 2 columns
myplot = Splot(2, 1)

r = [0, 20, 50, 80, 100]
for i in r:
    # load the data:
    dataPath = "data/4/" + str(i)
    G = data_dict(dataPath,
                  samplename='Ag',
                  scan=str(i),
                  marker='o',
                  Linestyle='')

    # plot data: y offset is set to the number of the file name
    myplot.plot_data(**G, offsety=i, calc=True, diff=True, diffoffset=0)

    # plot diff data at the bottom panel: Turn down the Meas and Calc curve,
    # Only turn on the diff by diff = True and meas = False.
    myplot.plot_data(**G, r=1, c=0, diff=True, meas=False, diffoffset=i / 24)

myplot.config(legend='out')

# Show figure and save
myplot.show()
myplot.save(name='Example_4_DiffAtSeparatedPanel', form='pdf')
コード例 #3
0
from splot.splot import data_dict, Splot

#get the data file Paths:
data1Path = "data/1/80"
data2Path = "data/1/10"

# Load the 2 Data sets, call them g1 and g2: use open marker for the Meas data
g1 = data_dict(data1Path, samplename='G', scan='80', marker='o', linestyle='')
g2 = data_dict(data2Path, samplename='G', scan='10', marker='o', linestyle='')

# plot axis setup: here we have 2 rows x 1 col
myplot = Splot(2, 1)

# plot data set 1: g1 at top panel, g2 at the bottom
myplot.plot_data(**g1, r=0, c=0, calc=True, diff=True)
myplot.plot_data(**g2, r=1, c=0, calc=True, diff=True)

# Figure configuration is always the last step
# Use 'context = manu', so no legend shown.
# Leave it blank, then the legends come back.
#myplot.config(context='manu')
myplot.config()

# See the figure and save
myplot.show()
myplot.save(name='Example_1_TwoPanMeasCalcDiff', form='pdf')
コード例 #4
0
from splot.splot import data_dict, Splot, bgcolor

#get the data file Paths:
data1Path = "data/2/sub_20161114-235343_Ag0_ct_180_2c77c1_0001.gr"
data2Path = "data/2/sub_20161115-002440_Ag100_ct_180_c73701_0001.gr"

# Load the 2 Data sets, call them g1 and g2: use open marker for the Meas data
data_set1 = data_dict(data1Path, samplename='Ag', scan='0')
data_set2 = data_dict(data2Path, samplename='Ag', scan='100')

# plot axis setup: a sinlge panel plot
myplot = Splot()

# plot data at the sinlge panel, no need to write row and col numbers
myplot.plot_data(**data_set1)
myplot.plot_data(**data_set2)

#plot the difference between the two data sets at panel(r=0, c=0):
myplot.curves_diff(data_set1, data_set2)

# Figure configuration, the last step
myplot.config(context='manu')

# Show the figure and save
myplot.show()
myplot.save(name='Example_2_MeasCompare', form='pdf')