From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/45155 Path: news.gmane.org!not-for-mail From: "Mojca Miklavec" Newsgroups: gmane.comp.tex.context Subject: Re: tikz and metapost Date: Tue, 28 Oct 2008 10:01:22 +0100 Message-ID: <6faad9f00810280201s5ffbca24j663a5d374f494a80@mail.gmail.com> References: <6b36c7890809230840j7e3cbe0ckc08032e65fa62306@mail.gmail.com> <200810261045.19152.alan.braslau@cea.fr> <6faad9f00810260346o5eb5893w378c2b72639b15b@mail.gmail.com> <200810261624.40265.alan.braslau@cea.fr> 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: ger.gmane.org 1225184636 10097 80.91.229.12 (28 Oct 2008 09:03:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Oct 2008 09:03:56 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Tue Oct 28 10:04:56 2008 connect(): Connection refused 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 lo.gmane.org with esmtp (Exim 4.50) id 1KukUi-0001iu-1U for gctc-ntg-context-518@m.gmane.org; Tue, 28 Oct 2008 10:04:08 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0A4721FBFB; Tue, 28 Oct 2008 10:03:00 +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 08653-01-5; Tue, 28 Oct 2008 10:01:57 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 94F4B1FB6D; Tue, 28 Oct 2008 10:01:57 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 72C751FB6D for ; Tue, 28 Oct 2008 10:01:56 +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 07872-02-3 for ; Tue, 28 Oct 2008 10:01:24 +0100 (CET) Original-Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.168]) by ronja.ntg.nl (Postfix) with ESMTP id 47AD91FA2B for ; Tue, 28 Oct 2008 10:01:24 +0100 (CET) Original-Received: by wf-out-1314.google.com with SMTP id 27so2474913wfd.5 for ; Tue, 28 Oct 2008 02:01:23 -0700 (PDT) Original-Received: by 10.142.186.9 with SMTP id j9mr510930wff.277.1225184482960; Tue, 28 Oct 2008 02:01:22 -0700 (PDT) Original-Received: by 10.143.159.5 with HTTP; Tue, 28 Oct 2008 02:01:22 -0700 (PDT) In-Reply-To: <200810261624.40265.alan.braslau@cea.fr> Content-Disposition: inline X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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:45155 Archived-At: On Sun, Oct 26, 2008 at 4:24 PM, Alan BRASLAU wrote: > Following some exchange off-list (trying to figure out how tikz under context > got broken), the subject of understanding pgf/tikz with respect to metapost > came up. I am posting a follow-up here as it may be of interest to others on > the mailing list, those who know metapost very well as well as those, like > myself, who are still learning how to use different graphics tools. > > On Sunday 26 October 2008 11:46:22 Mojca Miklavec wrote: >> > I am just starting to learn about metapost, and I can't judge yet >> > what pgf/tikz has as advantages and disadvantages. >> >> Advantages of TikZ: >> 1.) many many many many "libraries" that are ready-to-use. Just take a >> glimpse through the manual and it will be evident to you in the first >> glimpse. If you want to draw a graph, you can do it with a few >> commands. (one command draws you axis, one for function, ...) >> You can achieve the same with metapost, but you need to do everything >> from scratch. However, it's really easy to write your own libraries. >> 2.) some special effects like smooth shading works in metapost only >> conditionally (does not work with XeTeX at the moment), and you have a >> wider range with TikZ >> >> Advantages of metapost: >> 1.) rich mathematical machinery (you can write a set of equations and >> metapost will calculate your coordinates) >> 2.) easy to write your own macros > > I thought that a major interest of pgf/tikz was the production of portable > graphics (using many different motors). Right. That's also true, but portability is more about "the source code of TikZ only had to be written once" and "you only need to learn it once" when you write with both LaTeX and ConTeXt. Usually you don't need to exchange the same figures between LaTeX and ConTeXt documents anyway. But if you do need to convert, portable code indeed helps a lot. >> > As an experiment, I did try comparing making a graph using >> > pgfplot and metagraph, and I did *not* like the result of the second. >> >> metagraph is old as earth. > > graph.mp,v 1.2 2004/09/19 > Current estimates place the age of the earth at around 4.6 billion years... Compared to 4.6 billion years it would not matter, but I guess that mpgraph has been written by Hobby, and the most recent reference that he's quoting is from 1994. The date you see might be as trivial thing as Karl Berry adding the svn id on top of file (though I would not know it). And in computers 14 years with (almost) no modification ... speaks for itself. >> If I draw graphs is meapost, I do that >> manually. Or I use gnuplot module to draw graphs for me, but graph >> drawing is much easier & more flexible with TikZ if you have >> datapoints ready. > > I myself find gnuplot to be fatally flawed and have never liked using it. Flawed with/like? (I started using it since I didn't need to bother about anything. It just worked out of the box. I don't like most terminals, but with the right terminal it's quite ok.) > (I still sometimes produce graphics using an old program written in K&R C that > generates HPGL for pen plotters, with a filter that then creates postscript. > Now THAT is almost stone age! But this program can also handle an arbitrary > number of points VERY efficiently, only limited by the size of your storage > device.) And by the memory your printer has when you try to print that file ... :) :) :) (I need to draw some scatter plots now and need to figure a way to forget about all the tools that I know for creating nice vector plots ... Back to the nice old bitmaps!) >> If you need some complex curve, TikZ is improving in >> that area, but in metapost it's out-of-the-box to draw it. > > Why did Till Tantau write pgf/tikz? Clearly he knew metapost, so another route > could have been to develop a standard library of metapost macros. Before mplib came to existance metapost meant that TeX had to: - write mp code into file - run metapost to convert your file into PostScript - run other TeX jobs in background in order to get labels on MP figures And that is *awfuly* slow when you have to process multiple graphics with some text labels. Apart from that, you need to have some switch enabled (write18) that means a security issue when other people submit code to your server. The way TikZ is implemented runs faster than metapost with old-fashioned labels in mkii. Metapost in mkiv is comparable - you don't need any external program to generate graphics. What Till Tantau did whas bringing portability and efficiency of drawing into all formats and all engines of TeX. With a standard library for metapost he wouldn't gain on portability/efficiency, though he could clearly implement a library of the same strength much easier. TikZ is now *the* choice for drawing anything in (La)TeX. > I'm asking > these questions here as there seems to be a preference (or prejudice) towards > metapost amongst the context community. - TikZ is rather new - Hans has a large collection of own macros already (everything that he ever needed), so there's no point of rewriting everything into TikZ. - Moreover, he would loose control (if TikZ changes in some way or if someone has no TikZ installed). Metafun should always work, at least in theory. - Once you master one tool, it takes time to learn another one. If there are no huge differences, it doesn't pay off. - Metapost has some strengths that TikZ is lacking. According to what Jean Magnan says: metafun is usable with plain metapost as well. > Indeed, it appears pretty powerful. > But as Mojca wrote about glimpsing at the pgf/tikz manual, it too is very rich > and I have yet to learn about all of the new features that were introduced in > pgf-2.0. > > Thus, I am trying to figure out where to invest my learning efforts. Start reading "Learning METAPOST by Doing" and start reading the wonderful TikZ manual. If you need a powerful programming language that's easy to learn, take metapost. If you need to do fancy stuff or draw graphs in a few keystrokes, go for TikZ. Or simply learn both. (But do not forget to consider that *any* tool with GUI that can draw you a graph or image can do the job as well. If you want your texts in TeX, you can stil import figures from external sources.) Mojca ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________