From: Paul Menzel <paulepanter@users.sourceforge.net>
To: ntg-context@ntg.nl
Subject: Re: Plotting a graph of a function f, like f(x) = e^x, with MetaPost
Date: Thu, 13 Oct 2011 00:13:38 +0200 [thread overview]
Message-ID: <1318457618.1055.24.camel@mattotaupa> (raw)
In-Reply-To: <20111012053642.GA53825@iram-hb-003386.extra.cea.fr>
[-- Attachment #1.1: Type: text/plain, Size: 1665 bytes --]
Dear Alan,
Am Mittwoch, den 12.10.2011, 07:36 +0200 schrieb Alan Braslau:
> Metapost can now perform calculations in double precision floating point.
> At this time, it is in the svn version and does not work yet as
> such integrated in ConTeXt (through mplib). Taco promises this for soon...
great to hear that. Just to clarify, with »now« you mean MetaPost v2, do
not you? Taco, I hope you get there without a lot of problems showing
up. If you need testers a good option would be to integrate that into
ConTeXt Standalone as an option.
> The graph package is pretty clever, and I am working on proposals on
> how to extend/rewrite this taking advantage of the new metapost
> handling of large and small numbers.
Perfect!
> To plot a function, you can create a path, as in
> path p ; p :=
> for i=0 upto 1000:
> hide (x := i/1000 ;)
> if (i>0) -- fi (x,exp(x))
> endfor ;
> gplot p ;
What module do I need for `gplot`?
Looking at the MetaFun manual [8] I found out MetaFun even provides a
macro `function` which probably does exactly what you do above with the
for loop.
draw function(2,"x","x**(-0.5)",1,10,1) xyscaled (2cm,2cm)
withpen pencircle scaled 5mm withcolor
transparent(1,.5,yellow) ;
> One proposal will be to make this even easier with new macros.
Another perfect!
One thing coming to my mind though that hopefully the wheel is not
reimplemented. I guess Gnuplot can do a lot already, but on the other
probably not as neat as Metapost when we want to color certain areas.
Thanks,
Paul
[8] http://www.pragma-ade.com/general/manuals/metafun-s.pdf
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2011-10-12 22:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-11 22:45 Paul Menzel
2011-10-11 22:56 ` Paul Menzel
2011-10-11 22:58 ` Mojca Miklavec
2011-10-12 5:36 ` Alan Braslau
2011-10-12 22:13 ` Paul Menzel [this message]
2011-10-12 22:28 ` Mojca Miklavec
2011-10-12 23:19 ` Paul Menzel
2011-10-13 0:30 ` Mojca Miklavec
2011-10-13 7:32 ` Hans Hagen
2011-10-13 7:59 ` Alan Braslau
2011-10-13 8:04 ` luigi scarso
2011-10-12 6:40 ` luigi scarso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1318457618.1055.24.camel@mattotaupa \
--to=paulepanter@users.sourceforge.net \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).