8.1.10.1 GraphLayer::AddPlot

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.


Description

Add a plot to graph layer

Syntax

 AddPlot( pPyRange, PlotType)

Parameters

pPyRange
Datarange
PlotType
Plot type ID

Return

DataPlot

Examples

EX1

#Assume there are two columns with data in Book1
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)