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
 LabTalk Forum
 How to prepare data for Supply&Demand curve

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
porter Posted - 11/11/2010 : 1:16:31 PM
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!!!
2   L A T E S T    R E P L I E S    (Newest First)
porter Posted - 11/17/2010 : 01:08:59 AM
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

easwar Posted - 11/12/2010 : 3:15:04 PM
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

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