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
 Origin Forum
 Doing many histograms
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

pmoreira

Brazil
5 Posts

Posted - 02/07/2014 :  1:28:17 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear all,

I wanna create histograms for all my columns in each worksheet. O did a code below, but it draws only a first histogram (DIP is a template). What am I doing wrong?


//BEGIN
doc -e W
{
// For all Worksheets in current Workbook
oop(iWks,1,page.nlayers);
{
// Make next Sheet active
page.active = iWks;
// For all columns in the active Sheet
loop(iCol,1,wks.ncols)
{

if (%(wks.col$(iCol).name$) == "A" || %(wks.col$(iCol).name$) == "B" || %(wks.col$(iCol).name$) == "C" && %(page.name$) == "A160"){
worksheet -p 219 DIP;
ty %(page.name$), %(layer.name$), %(wks.col$(iCol).name$);
};

}
}
}

lkb0221

China
497 Posts

Posted - 02/07/2014 :  2:14:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

There are three problems in your script.
1). The iWks loop should not have semicolon. (And you missed the letter "l")
2). "window -p" plots the selected column in the worksheet, if you want to use this command, you need to specify which columns are selected each time by "wks.colsel".
3). After each time you plotted a graph, the new graph window will be activated automatically. You need to activate the worksheet back.

The following is my modified script (the if condition is removed to make it simple):

//Start
doc -e W
{
//type This is %H;
%Z = %H; // Remember the workbook
loop(iWks,1,page.nlayers)
{
page.active = iWks;
//type This is Sheet $(iWks);
loop(iCol,1,wks.ncols)
{
plotxy iy:=$(iCol) plot:=219;
window -a %Z; // Activate the workbook
}
}
}
// End

Zheng
OriginLab

Edited by - lkb0221 on 02/07/2014 2:35:24 PM
Go to Top of Page

pmoreira

Brazil
5 Posts

Posted - 02/10/2014 :  07:12:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Zheng.

Thank you.

Pedro
Go to Top of Page

pmoreira

Brazil
5 Posts

Posted - 02/10/2014 :  07:32:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
How can I change the properties of histogram created? Bin size, max, minimum and normalize the frequency (divided the y-axis by number)?
Go to Top of Page

lkb0221

China
497 Posts

Posted - 02/10/2014 :  09:57:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You have a template for those histograms, right?
You can include it into "plotxy" when creating, see the page below for details:
http://www.originlab.com/doc/X-Function/ref/plotxy
Go to Top of Page

pmoreira

Brazil
5 Posts

Posted - 02/10/2014 :  10:53:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Ok, I use my temnplate. But the scale on y-axis is changed automatically. I tried to rescale, using:

range ll = [%C]1!;
ll.y.from = 0.0;
ll.y.to = 0.1;


However, it is not working. It rescales in other values. What am I doing wrong? (Note: It works for x-axis)
Go to Top of Page

lkb0221

China
497 Posts

Posted - 02/10/2014 :  11:06:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Your range assignment is wrong.
you should use:

range rr1 = [Graph1]1!; // Layer 1 of Graph 1
range rr2 = [%H]1!; // Layer 1 of current graph window

Besides, I don't think changing Y scale of a histogram directly would be a good idea, for it will ruin your graph.
You can send us your opj file with some detailed description so that we can understand your requirement more clearly.

Zheng
OriginLab

Edited by - lkb0221 on 02/10/2014 11:09:06 AM
Go to Top of Page

pmoreira

Brazil
5 Posts

Posted - 02/10/2014 :  11:33:16 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
How can I send my file and a description what I need?

Pedro
Go to Top of Page

lkb0221

China
497 Posts

Posted - 02/10/2014 :  11:38:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can send by email to tech@originlab.com .

If the file is too big (>200K for example), you can use our FTP by following:
http://originlab.com/index.aspx?go=Support&pid=752

Edited by - lkb0221 on 02/10/2014 11:38:52 AM
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