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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 combine plot_heatmapxyz with graph or template
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Karsten8

Germany
23 Posts

Posted - 06/14/2022 :  07:41:13 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: 2022b / 9.9.5.167
Operating System:Win10

Hello forum,

I have some trouble with the plot_Heatmapxyz-function and I found no other entry in the forum. It would be great if you have some suggestions how to solve the two points.

1) I want to plot a heatmap into a modified graph. Typically I use a modified graph (width additional text, pictures,..) -> dublicate this graph and then plot the data into this dublicated graph. So far I could not find the right procedure to plot the heatmap into my dublicated graph (e.g. graphV1 <- this is an empty heatmap-plot).

Beside the "template:=graphV1" the whole command line works:

plot_heatmapxyz -r 1 iz:=[wb-name]Sheet1!(J"X",K"Y",S"V20") x.inc:=1 label:="Langname (oder Kurzname)" rd:=[wb-name]V20map! template:=graphV1

How does the command has to be written to get the plot into graphV1?

If I save my graphV1 as template into my UFF it works, but I want to write a script where there is no external link to templates to prevent broken links if the network is not present or the user works on a notebook without connection.

2) When I use the following code within my labtalk-script the program stops when it arrives the plot_heatmapxyz-command. But if I write alle the steps by hand into the origin command-window it works without error message:

error messsage from code builder: Missing DataID for Node with Name = , Label =

Code from labtalk:
string KEYvalNAME$ = "name of the workbook";
win -a %(KEYvalNAME$);
plot_heatmapxyz -r 1 iz:=[%(KEYvalNAME$)]Sheet1!(BN"Xges",BO"Yges",X"V1000") x.inc:=1 label:="Langname (oder Kurzname)" rd:=[%(KEYvalNAME$)]V1000map! template:=Heat_Map;

using (KEYvalNAME$) insteat of %(KEYvalNAME$) to direct to the workbook it is the outcome. Why does the program stop at this code in labtalk-script but not if I put every line into the command window?

Thanks for your help.

Best regards,
Karsten8.

Edited by - Karsten8 on 06/15/2022 02:05:01 AM

cpyang

USA
1406 Posts

Posted - 06/15/2022 :  09:57:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Looks like the code for plot_Heatmapxyz is inside that XF, so it is not easy to reuse. We will have to take that OC code out to make a separate XF. We can restructure this area for the next version, but in the meantime, they only way you can make use of this change is to use our upcoming beta1.

I added ORG-25383 for this.

CP
Go to Top of Page

Karsten8

Germany
23 Posts

Posted - 06/15/2022 :  10:19:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear CP,

thanks for your answer. I will wait till the next official release (2023?) and use the template approach in the meantime.

Do you have an idea why the script stops at the plot_heatmap command within a labtalk script but not if I run every script line by hand in the command window?

Best regards,
Karsten8.
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 06/15/2022 :  10:53:38 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I think because the XF is creating sheet/window and some code will not run until window repaint message.

You can insert "sec -p 1" to force a waiting.

See
https://www.originlab.com/doc/LabTalk/ref/Second-cmd#-p.3B_Pause_for_the_specified_number_of_seconds


CP
Go to Top of Page

Karsten8

Germany
23 Posts

Posted - 06/16/2022 :  09:33:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear CP,

I found the reason: I use a script to import form a database into a worksheet. This worksheet is then used as source to be plotted by the plot_heatmapxyz.

The reason why it did not work was due to a calculation that was implemented inside two colums of the worksheet (green lock-symbol at top of the colum). I found that the calculations are realized at the end of my script. I.e. when the script tries to plot the two columns are not yet calculated. Then the plot-function can not draw a non-existing data. I learned that it's better to write a cset .... command to force the caluclation inside the script. Then the heatmap-plot-function finds data and it works.

A tricky problem

Thanks for your help.

Best regards,
Karsten8.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000