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
 How to prepare data for Supply&Demand curve
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

porter

Canada
4 Posts

Posted - 11/11/2010 :  1:16:31 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I just started with OriginLAB and I would like to automatically generate a supply and demand graph as shown below:



I am importing a csv-file in Book1(Buyer) and Book2 (Seller).My data looks as:

____For Buyer___________________For Seller

Quantity___Price____________Quantity_____Price
10___________6________________30___________1
20___________5________________10___________3
30___________4________________20___________5
10___________2________________10___________6

Here my questions:
1)How can I produce the above graph based on these data (quantities have to be cumulative)
2)How to mark the clearing price

Thanks for your help!!!

easwar

USA
1965 Posts

Posted - 11/12/2010 :  3:15:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

For cumulative numbers it is easy to compute that such as say
col(3)=sum(col(1))
and can then plot col(3) as X and col(2) as y, here I am assuming original quantitiy is in col1 and price in col2.

You can use plotxy X-Function to plot by defining range with desired columns, and you can use a pre-defined template.

Now, in the plot, the line setting you want is step-horizontal? If that is the case, then I am not sure how to find the exact intersection point where the step-line-style will cross. If you don't want that and can assume linear line style it may be simpler.

In any case, can you send us some real data and then we can see how to best script this?

You can send the data to tech support and then please refer to this thread. See this page on how to send data:
http://www.originlab.com/index.aspx?go=Support&pid=752

Easwar
OriginLab
Go to Top of Page

porter

Canada
4 Posts

Posted - 11/17/2010 :  01:08:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Thanks a lot for your support and your suggestions. I am now able to generate a “supply and demand graph” out of my data.
The process is “semi automatic” as I am not having one single script yet, which does everything. So far I do the following operations in different steps:
1) Importing
2) Removing units abs(a) …. (a=Left(Col(bid_quantity),(Len(Col(bid_quantity))-2))$)
3) Querying data (Worksheet query)
4) Summing data (labtalk: wxt test:="col(A) = 62 and col(D) = "buyer*"" ow:="Extracted1";wks.addcol(new);doc -uw;col(9)=sum(col(7));
5) Preparing the graphs
Additionally I would like to include a stacked panel graph showing different markets events (market ids).

Herewith I am also sending you some real data. Any help, how to integrate the above steps into one single script would be appreciated.

Thanks!!!
Porter

quote:
Originally posted by easwar

Hello,

For cumulative numbers it is easy to compute that such as say
col(3)=sum(col(1))
and can then plot col(3) as X and col(2) as y, here I am assuming original quantitiy is in col1 and price in col2.

You can use plotxy X-Function to plot by defining range with desired columns, and you can use a pre-defined template.

Now, in the plot, the line setting you want is step-horizontal? If that is the case, then I am not sure how to find the exact intersection point where the step-line-style will cross. If you don't want that and can assume linear line style it may be simpler.

In any case, can you send us some real data and then we can see how to best script this?

You can send the data to tech support and then please refer to this thread. See this page on how to send data:
http://www.originlab.com/index.aspx?go=Support&pid=752

Easwar
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