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
 plot histogram using labtalk
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Konrad_Loehr

Germany
5 Posts

Posted - 07/27/2017 :  06:42:29 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 2017
Operating System: Win7

Hi everybody! :)

I would like to plot data in a histogram using labtalk.
I already noticed the histogram function
http://www.originlab.com/doc/LabTalk/ref/Histogram-func
, but I would like to use the 'plot Histogram' function I know from the user interface, since it defines bins etc. automatically and can be adjusted using a graphical interface later on.

Is that possible?

Best
Konrad

Konrad Loehr

Edited by - Konrad_Loehr on 07/27/2017 06:42:57 AM

Hideo Fujii

USA
1582 Posts

Posted - 07/27/2017 :  12:06:44 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Konrad Loehr,

The following sample snippet can do:
bk$="Book1";
range rs = [%(bk$)]1!;  //1st sheet
rs.colSel(2,1);  //highlight 2nd column in the sheet
window -a %(bk$);
worksheet -p 219 Hist;
Does this work in your code?

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 07/27/2017 12:10:30 PM
Go to Top of Page

Konrad_Loehr

Germany
5 Posts

Posted - 08/03/2017 :  09:05:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Hideo Fujii,

thank you a lot for you quick reply! - it does exactly, what I wanted :)

But that brings up a new problem:
I want to import data using the import wizard and by such I don't know the name of my workbook, as I'm importing several files and want to name their workbooks using the original filenames. ("Rename: workbook with filename" is checked in import wizard gui). For example if a file is called "1_to_1000_dilution.txt", the long name will be the same, and the short name will be "A1100dilutio". How to get the short name of the workbook to create the range?

Konrad Loehr
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 08/07/2017 :  11:58:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Konrad Loehr,

> How to get the short name of the workbook to create the range?

You can use the long name to define the range. When you need the short name (like for Window command),
you can get it by <range>.name$ . The following sample snippet worked:
bk$="1_to_1000_dilution.txt";
range rs = [%(bk$)]1!;  //1st sheet
rs.colSel(2,1);  //highlight 2nd column in the sheet
bkshortname$=rs.name$;
window -a %(bkshortname$);
worksheet -p 219 Hist;
Hope this helps.

--Hideo Fujii
OriginLab

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