From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/22861 Path: news.gmane.org!not-for-mail From: David Arnold Newsgroups: gmane.comp.tex.context Subject: Re: function plotting Date: Tue, 4 Oct 2005 23:17:27 -0700 Message-ID: <8CF727E2-EDD0-49F4-AB8A-49DF6A9E1AC4@northcoast.com> References: <20051002172755.GA17649@none.at> <43401ECE.2030309@creutzig.de> <20051002185852.GB19384@none.at> <434044D5.8090109@creutzig.de> <20051003080358.GA3782@none.at> <434169BB.4000008@creutzig.de> <20051004082954.GA20838@none.at> <6faad9f00510041048l25e0b9f0m@mail.gmail.com> <20051004192047.GB30718@none.at> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v728) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1128494737 31441 80.91.229.2 (5 Oct 2005 06:45:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 5 Oct 2005 06:45:37 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Wed Oct 05 08:45:26 2005 Return-path: 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 1EN30i-00021x-Bk for gctc-ntg-context-518@m.gmane.org; Wed, 05 Oct 2005 08:44:16 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 25436127EC; Wed, 5 Oct 2005 08:44:16 +0200 (CEST) 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 05069-05-6; Wed, 5 Oct 2005 08:44:11 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C0469127CC; Wed, 5 Oct 2005 08:44:11 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id CB1D3127EA for ; Wed, 5 Oct 2005 08:44:10 +0200 (CEST) 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 05069-05-5 for ; Wed, 5 Oct 2005 08:44:09 +0200 (CEST) Original-Received: from borg.inreach.com (mail.northcoast.com [209.142.2.71]) by ronja.ntg.nl (Postfix) with SMTP id 5116B127DE for ; Wed, 5 Oct 2005 08:18:27 +0200 (CEST) Original-Received: (qmail 4614 invoked from network); 5 Oct 2005 06:15:48 -0000 Original-Received: from unknown (HELO ?209.209.20.87?) (209.209.20.87) by mail.northcoast.com with SMTP; 5 Oct 2005 06:15:48 -0000 In-Reply-To: <20051004192047.GB30718@none.at> Original-To: mailing list for ConTeXt users X-Mailer: Apple Mail (2.728) 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-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:22861 Archived-At: Alexander, There is a lot of plots you can do with Metapost. Ordinary, every day stuff. For example: beginfig(1); % initialize a and c for f(x)=|x-a| and g(x)=c numeric a, c; a=-2; c=2; % initialize function label abcissas and postions numeric flabel, glabel; flabel:=-5; glabel:=-5; % define function f(x)=|x-a| vardef f(expr x)= abs(x-a) enddef; % draw line with given point and slope path F; F:=(-5,f(-5)); for x=-5 step 1 until 5: F:=F--(x,f(x)); endfor; % initialize scale numeric u; 10u=4cm; % the line F:=F scaled 1u; draw F withcolor blue; % clipping path path cpath; cpath:=(-5,-5)--(5,-5)--(5,5)--(-5,5)--cycle; cpath:=cpath scaled 1u; % clip and save current picture picture pic; clip currentpicture to cpath; pic:=currentpicture; % erase currentpicture currentpicture:=nullpicture; % draw grid for k=-5u step 1u until 5u: draw (-5u,k)--(5u,k) withcolor 0.85white; draw (k,-5u)--(k,5u) withcolor 0.85white; endfor; % draw axes drawarrow (-5u,0)--(5u,0); drawarrow (0,-5u)--(0,5u); % label axes label.rt(btex $x$ etex, (5.2u,0)); label.top(btex $y$ etex, (0,5.2.u)); label.bot(btex $5$ etex, (5u,0)); label.lft(btex $5$ etex, (0,5u)); % redraw line draw pic; % label the functions f(x)=|x-a| and g(x)=c pair D, E; D:=(-5,f(-5)) scaled u; label.lft(btex $f$ etex,D); E:=(-5,2) scaled u; label.lft(btex $g$ etex, E); % draw the graph of g(x)=c path G; G:=(-5,2)--(5,2); G:=G scaled u; draw G withcolor blue; endfig; end. And for a good stats package, see: http://www-math.univ-poitiers.fr/~phan/statsmac.html And for good circuits diagrams, see: http://www.cnm.es/~pserra/schema/whatis.html Don't give up on Metapost too soon. It's an awesome language and the file size created are small, a plus when you're document includes lots of figures and you want it to download in reasonable time on the internet.