Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

-Top Features

Feature

How to

Python improvements

We have introduced a new originpro package for easy access to Origin from Python. This package works on a higher level, providing easy access to workbooks, matrices and graphs with very little code. The package also provides higher level access to data frames and numpy arrays.

Several sample Origin projects have been added under \Samples\Python sub folder. These samples have Python code attached as .py files in the project.

View documentation including detailed reference for the orignipro package.

Improvements in Beta2:

Excel like formula bar

  • Read current cell contents. Useful for cell with long text.

  • Enter column formula when column header is selected.

  • Enter cell formula when a cell is selected.

  • Hunt to define range. E.g. with B1 cell selected, in formular bar, enter =mean(, then drag from A1 to A10, the formula will show =mean(A1:A10, then user can enter ) and press Enter key to finish the formula.

Mini toolbar Improvements

Mini toolbars for text label, legend, color scale, bubble scale, and graphic objects are improved.

Color Palette Improvements

Drag and drop palette types from other popular software.

...

JIRA

SUMMARY

DETAILS

ORG-20778

Excel like pi product function

double product(vector vd)

E.g. column A is filled with 2, 3, 4, 5

In B1 cell, enter = product(A) will 120, which is 2*3*4*5.

ORG-21992

Excel like LET function

Easier to write complex formulas, by making it possible to declare and assign values to variables inside a formula

LET(name1, exp1, [name2…], [exp2…], calculation)

exp1 is resolved and assigned to name1, exp2 is resolved and assigned to name2, then assign names to calculation for result. 

LET(x, 1, x+1) -> 2

LET(sum, total(A), n, count(A), sum/n)

ORG-13898

Command Window

support mouse wheel zoom, more support on auto complete

ORG-21926

Introduce new LabTalk command to update pending locks

Code Block
run -p aub;//active book
run -p auw;//active sheet
run -p aubd;//active book and all its descendants
run -p auwd;//active sheet and all its descendants

ORG-21587

LabTalk Access to Dash Definition at Plot Level

Syntax: set name -ldf value

Code Block
set %c -ldf  "5 20 10";

ORG-19233

GetN supports dataset elements

E.g.

dataset values;
values.setsize(3);
getn (Value 1) values[1] (Value 2) values[2] (Value 3) values[3];

ORG-22214

LT Labtalk control of Box Plots – Beta2

layer.plot1.boxchart.line=1,2,3; //show lines in box chart, 1=median,2=mean or 3 both

layer.plot1.boxchart.label=1,2,3;//show label of line, 1=median,2=mean or 3 both

layer.plot.label.font=1; //label font

layer.plot1.label.fsize=20; //label font size

layer.plot1.label.color=2; //label color based on color list, e.g. 1=black, 2=red, etc.

Python

JIRA

SUMMARY

DETAILS

ORG-22062, ORG-21995, ORG-22031, ORG-22107

Introduce originpro module

get/set between pandas DataFrame and Origin worksheet, matrix, graph etc.

https://www.originlab.com/python/doc/originpro/annotated.html

Code Block
import pandas as pd
import originpro as op
wks=op.find_wsheet()
df = wks.to_df()

wks = op.new_wsheet( 'Test Category' )
wks.from_df( df )

ORG-20980

Update preshipped Python version

upgrade Python to 3.8.3

ORG-21988, ORG-11812

menu access

  1. Under menu Connectivity add new menu Python IDE in Code Builder.

  2. In Code Builder, add menu Python Packages under Tools.

  3. Start Debug button on toolbar (F5) to run Python file.

ORG-22024

Wrap text in Python Console

Allow auto wrapping for dir command’s output in Python Console.

ORG-22046

Add return value for some Python Object

method like GetNumProp, SetNumProp, DoMethod etc. now has return value.

ORG-22075

Remove Python 2 from installation

Stop supporting Python 2.

ORG-21993

Support Python PIP command

All pip commands are supported in LabTalk now.

For example, you can use following command to install numpy package directly.

Code Block
pip install numpy;

ORG-22049

Install Packages from Code Builder Py Editor Tools menu

Add Python Packages tool to install/uninstall internal python packages.

In Code Builder, select Tools: Python Packages…

ORG-22070

OC to call Python functions

OC supports calling Python functions. By default the py file should be placed in the same folder as the c/cpp or XF file, and the name of the py file has to be origin.py.
To change that, you need to

  1. to change working directory

Code Block
Python.OCWD$;//OC Working Directory

2. to change file name(independent of 1)

Code Block
Python.OCWF$;//OC Working Filename

ORG-22239

Beta Tester Feedbacks -- show Python print immediately

Added a system variable @PYO to control if show Python print immediately for Embedded Python.

Code Block
@PYO=1(default):immediate output
@PYO=0:output at the end

For example:

Code Block
import PyOrigin as po
print('before')
po.LT_execute('typ hi')
print('after')

if @PYO=1, will output as

Code Block
before
hi
after

if @PYO=0, will output as

Code Block
hi
before
after

...