From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/67841 Path: news.gmane.org!not-for-mail From: Mojca Miklavec Newsgroups: gmane.comp.tex.context Subject: Re: =?utf-8?q?OT=3A_drawing_graphs=3A_Asymptote=2C_Gnup?= =?utf-8?b?bG90LCBNZXRhRnVuLCDigKY=?= Date: Mon, 18 Apr 2011 23:42:16 +0200 Message-ID: References: <1303158001.3910.257.camel@mattotaupa> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1303162961 10500 80.91.229.12 (18 Apr 2011 21:42:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 18 Apr 2011 21:42:41 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Apr 18 23:42:37 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QBwDM-000896-Ax for gctc-ntg-context-518@m.gmane.org; Mon, 18 Apr 2011 23:42:36 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8FBC5CAC0B; Mon, 18 Apr 2011 23:42:35 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 1a4zRsplVFF3; Mon, 18 Apr 2011 23:42:32 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6CFA4CABFC; Mon, 18 Apr 2011 23:42:32 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 04968CABFC for ; Mon, 18 Apr 2011 23:42:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id KvWVfN+X1Jfr for ; Mon, 18 Apr 2011 23:42:20 +0200 (CEST) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id D7E3ACABDF for ; Mon, 18 Apr 2011 23:42:19 +0200 (CEST) Original-Received: from mail-qw0-f41.google.com (mail-qw0-f41.google.com [209.85.216.41]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p3ILgGsh030406 for ; Mon, 18 Apr 2011 23:42:19 +0200 Original-Received: by qwa26 with SMTP id 26so4028085qwa.14 for ; Mon, 18 Apr 2011 14:42:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=orP1D5E+YrkzEjAHRtP5FLC26FCkWSpsjIRgBX4lFU4=; b=sxySOp6yEnzMC2dc9hUo1MMJPWtayoAsynTKtoX/XSyV7vh15K05O2D5nv7wzLyXka 8Nb3m2ie3O8OVuhp59vuB7Rxl4NLisQsV9KOoX54c3XetTgp4I7NIfdx54UpFk7Tz9xA UfB7fGwPguQ+rdFfsZhM2k26nzPsjicTUJmz0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=JCXDXiNUVfFm0ErjssCBgjljzGX9IVrTo3qeAYuaEvWIpax2bABWvNobLtRKLAM5dB 4WYHVE1slXKNsliA6MJzWztwIEWux7oFvtdLTP9e1JIx0k2qMisahUscqGZJ3/VkHD1O k4RuukhScBc5J0aGVp1ZRQibpNriT0j/32how= Original-Received: by 10.229.102.85 with SMTP id f21mr3899566qco.25.1303162936111; Mon, 18 Apr 2011 14:42:16 -0700 (PDT) Original-Received: by 10.229.11.83 with HTTP; Mon, 18 Apr 2011 14:42:16 -0700 (PDT) In-Reply-To: <1303158001.3910.257.camel@mattotaupa> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.216.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03Ex9GgEN - d09d77e1ecbf - 20110418 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.72 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:67841 Archived-At: On Mon, Apr 18, 2011 at 22:20, Paul Menzel wrote: > Dear ConTeXt folks, > > I need to plot some random walks similar to [1], but for example I need > to emphasize certain sections of the plot and put labels and notes in > there. > > Could you recommend a tool to easily accomplish that goal with easily. I > guess it can be done with any of those as seen by the demos [2][3]. > > I only have little experience using Gnuplot and I have never used > Asymptote or MetaFun. These three seem to be well integrated with > ConTeXt and I guess in the end I could just create the image files and > include these in to my ConTeXt source. > > The only downside of Asymptote I found so far is, that there is no > mailing list. Below you have an example done in metapost/metafun (which integrates well with ConTeXt). The downside of metapost is that you have to do all the labels and axis drawing more or less manually, while gnuplot will take care of drawing axes and properly adjusting the range etc. On the other hand metapost might be quite powerful for geometrically complex graphics. If you use gnuplot, you might need to precompute the points for the random walk (it supports random numbers, but I'm not sure if you can calculate sums), while metapost can do some reasonable calculations on the fly. For 2D graphics asymptote doesn't bring you much. Yet another alternative is TikZ and pgfplots (similar to metapost, more library functions ready to draw all kinds of graphics, but less powerful math engine that in metapost). \setupcolors [state=start] \starttext \startMPpage save wx, wy; wx = 15cm; wy = 10cm; draw unitsquare shifted (0,-0.5) xyscaled (wx,wy); save val; numeric val; save tmp; numeric tmp; save p; path p; save c; color c[]; c[1] = red; c[2] = .5[red,yellow]; c[3] = .6green; c[4] = blue; c[5] = .4white; vardef newval = val := val + floor(uniformdeviate(2))*2-1; (val) enddef; for n=1 upto 5: val := 0; draw (0,0) for i=0 upto 100: -- (0.01*i*wx,0.025*newval*wy) endfor withcolor c[n]; endfor for i=0 step 20 until 100: label.bot(decimal(i), (0.01*i*wx,-.5*wy)); endfor; for i=-20 step 5 until 20: label.lft(decimal(i), (0,0.025*i*wy)); endfor; \stopMPpage \stoptext ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________