From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/24728 Path: news.gmane.org!not-for-mail From: David Arnold Newsgroups: gmane.comp.tex.context Subject: Metapost -- What am I doing wrong Date: Sun, 25 Dec 2005 10:08:44 -0800 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1135534337 25890 80.91.229.2 (25 Dec 2005 18:12:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 25 Dec 2005 18:12:17 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sun Dec 25 19:12:16 2005 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1EqaLv-0000qf-0U for gctc-ntg-context-518@m.gmane.org; Sun, 25 Dec 2005 19:12:15 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 79826127C5; Sun, 25 Dec 2005 19:12:14 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 18571-03; Sun, 25 Dec 2005 19:12:14 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 08E48127BA; Sun, 25 Dec 2005 19:10:01 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A9B93127BA for ; Sun, 25 Dec 2005 19:09:59 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 18571-02 for ; Sun, 25 Dec 2005 19:09:58 +0100 (CET) Original-Received: from fed1rmmtao09.cox.net (fed1rmmtao09.cox.net [68.230.241.30]) by ronja.ntg.nl (Postfix) with ESMTP id 281AD127B7 for ; Sun, 25 Dec 2005 19:09:57 +0100 (CET) Original-Received: from [10.0.1.2] (really [70.191.56.23]) by fed1rmmtao09.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20051225180959.LNIB25099.fed1rmmtao09.cox.net@[10.0.1.2]> for ; Sun, 25 Dec 2005 13:09:59 -0500 Original-To: Context Mailing List List X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:24728 Archived-At: All, Can someone tell me what I am doing wrong here? %Ouput=pdf \setupcolors[state=start] \definecolor[gridlines][s=0.7] \startMPinclusions color gridlines; gridlines=\MPcolor{gridlines} \stopMPinclusions \startMPgraphic{create function path f 5-by-5} %define clipping path path cpath; cpath:=(-5,-5)--(5,-5)--(5,5)--(-5,5)--cycle; %create function path path p; p:=(-5,f(-5)); for x=-5 step .1 until 5: p:=p--(x,f(x)); endfor; p:=p--(5,f(5)); %clip function path to clipping path p:=p cutbefore cpath; p:=reverse p; p:=p cutbefore cpath; \stopMPgraphic \startMPgraphic{scale and draw f 5-by-5} %scale function path p:=p scaled u; %draw function path drawdblarrow p withcolor blue; \stopMPgraphic \startMPgraphic{draw axis 5-by-5} %draw the grid for k=-5u step 1u until 5u: draw (k,-5u)--(k,5u) withcolor gridlines; draw (-5u,k)--(5u,k) withcolor gridlines; endfor; %draw axes drawdblarrow (-5.2u,0)--(5.2u,0); drawdblarrow (0,-5.2u)--(0,5.2u); %label axes label.rt(btex $x$ etex, (5.2u,0)); label.top(btex $y$ etex, (0,5.2u)); label.bot(btex $5$ etex, (5u,0)); label.lft(btex $5$ etex, (0,5u)); \stopMPgraphic \starttext \startMPpage %define function vardef f(expr x)= x*x enddef; \useMPgraphic{create function path f 5-by-5} %initialize scale numeric u; 10u=2in; \useMPgraphic{draw axis 5-by-5} \useMPgraphic{scale and draw f 5-by-5} %draw plotted points for x=-2 step 1 until 2: drawdot ((x,f(x)) scaled u) withpen pencircle scaled 4pt withcolor blue; endfor; \stopMPpage \stoptext %%% Local Variables: %%% mode: conTeXt-en %%% End: