The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Python
 Plotting 2D Contour plot via python

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
OriginUser_FS Posted - 01/31/2023 : 07:59:35 AM
Origin Ver. and Service Release (Select Help-->About Origin): 2022
Operating System: Windows 10

Hello everyone,

i have a question to the use of python outside of origin to plot 2D contour plots. I saw in this entry (https://www.originlab.com/doc/python/Examples/Graphing) that it is possible to plot a contour plot using xyz coordinates. Is it also possible to plot it via a virtual matrix like it is in the origin application itself? (so via the plotvm)
I am having a lower number of x coordinates, than i am having of y and z, which would make the use of the virtual matrix very practical.


Thanks in advance and best regards
FS
5   L A T E S T    R E P L I E S    (Newest First)
YimingChen Posted - 02/02/2023 : 09:47:44 AM
What object did you create with LT? Do you mean the window object like layer, axis, etc? Or do you mean graph object? Please check the two pages below:
https://www.originlab.com/doc/LabTalk/ref/Visual-objs-Created-by-Origin-obj
https://www.originlab.com/doc/LabTalk/ref/Graphic-objs

Regarding the script to export worksheet to csv, can you try below?
op.lt_exec(r'expASC path:="c:\signal.csv";')


James
OriginUser_FS Posted - 02/02/2023 : 04:42:52 AM
sorry for the odd question, but i am not so familiar with labtalk, but how do i access the graph object i created with the labtalk command? To then execute the methods, to manipulate the graph, you also referred to.

The only thing it is returning is a bool, and i couldnt find another labtalk command to assign it to a variable.

Furthermore i tried to export a worksheet as a csv file with
op.lt_exec("expASC path:="c:\signal.csv";") and i am getting an Syntax error for "C:" at this stage. Im not quite sure why this happens, because i just took the command line as it was written here: https://www.originlab.com/doc/en/X-Function/ref/expASC

BR
FS
YimingChen Posted - 02/01/2023 : 09:01:19 AM
Please check the Python reference page below:
https://docs.originlab.com/originpro/classoriginpro_1_1graph_1_1GLayer.html#ade5e9d47cf32ffa00ac59728605ea04e

https://docs.originlab.com/originpro/classoriginpro_1_1graph_1_1Plot.html#a7545ca68323d5cf9ce8de84edfcb478f

James
OriginUser_FS Posted - 02/01/2023 : 04:45:55 AM
Thank you very much, helped me a lot.

I didnt find any argument to set the ranges of the x, y or z values displayed. There is sth called rowrng however this selects, as i got it, only the x/y row if we did not specify it in rowpos. Is there anything i overlooked, or is there maybe another function to do that?

BR
FS

YimingChen Posted - 01/31/2023 : 3:28:51 PM
plotvm is actually an X-function so the add_plot method in Python won't work. You can call X-function from Python though. Please activate the worksheet of your data, and run the Python script below:
op.lt_exec("plotvm rowpos:=none colpos:=none ogl:=<new template:=contour>;")


James

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000