| DataRange::Add
    
      |  | It is recommended that you switch to the originpro package. PyOrigin is primarily for users who need to work with Origin version prior to 2021. |    DescriptionAdd a new subrange to the DataRange. Syntax
Add(Type, pPyWks, R1, C1, R2, C2)
 Parameters
    Type The name of the subrange like "X", "Y", "Z", or "ED" for Y error. "X" is a general usage, if no need to specify data is XY, XYZ etc. 
    pPyWks Worksheet or MatrixLayer in which range reside 
    R1 Row range begin 
    C1 Column range begin 
    R2 Row range end, use -1 to indicate end of column 
    C2 Column range end, if only one column then put in same value as nC1, if to end of worksheet use -1 ReturnReturns the number of subranges in the DataRange after execution. ExamplesEX1 
# Prepare book1 with data in Col(1) and Col(2)
import PyOrigin
data=PyOrigin.NewDataRange()
Sheet=PyOrigin.WorksheetPages('Book1').Layers(0)
if data.IsValid():
    data.Add('X', Sheet, 0, 0, -1, -1)
gp = PyOrigin.FindGraphLayer('Graph1')
gp.AddPlot(data, 1)
 |