From mboxrd@z Thu Jan 1 00:00:00 1970 From: Detlef Steuer Subject: Re: org-babel python/shell or gantt charts with gnuplot from within org-mode Date: Wed, 14 Apr 2010 10:02:17 +0200 Message-ID: <20100414100217.707f1d97@linux.site> References: <871veji3sk.fsf@gmail.com> <87zl16q3tg.fsf@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O1xV5-00037R-34 for emacs-orgmode@gnu.org; Wed, 14 Apr 2010 03:59:07 -0400 Received: from [140.186.70.92] (port=46160 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1xV3-000372-CN for emacs-orgmode@gnu.org; Wed, 14 Apr 2010 03:59:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O1xV0-00037z-Mk for emacs-orgmode@gnu.org; Wed, 14 Apr 2010 03:59:05 -0400 Received: from lo.gmane.org ([80.91.229.12]:35434) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1xV0-00037i-9p for emacs-orgmode@gnu.org; Wed, 14 Apr 2010 03:59:02 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1O1xUy-0007Nt-1h for emacs-orgmode@gnu.org; Wed, 14 Apr 2010 09:59:00 +0200 Received: from e176072229.adsl.alicedsl.de ([85.176.72.229]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Apr 2010 09:59:00 +0200 Received: from detlef.steuer by e176072229.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Apr 2010 09:59:00 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi! May be it's of interest. There's an R package 'plotrix' which seems to be able to create gantt charts.=20 Example picture: http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=3D74 Disclaimer: I don't know anything about gantt charts or that particular pac= kage. Hth Detlef On Tue, 13 Apr 2010 20:24:11 -0400 Dan Davison wrote: > Erik Butz writes: >=20 > > Hi Eric, > > > > thanks for this information, this already brings me one step further. > > > > There is now another issue which I run into, trying to get this to > > work: python lists seem to be a potential problem. In the code there > > are several lists which are constructed by a > > > > # Generate gnuplot lines > > plot_lines =3D ['plot ' + > > ', \\\n\t'.join((' '.join(['-1', > > 'title "%s"' % t, > > 'with lines', > > 'linecolor %s %s ' % > > (colorprefix, colors[t]), > > 'linewidth 6']) > > for t in tasks))] > > > > which cause the program to fail and not to produce any output when acce= ssed. > > > > I can create lists with append('a') however and use them mostly w/o pro= blems. > > > > Is there any know limitation somewhere in org-babel or am I running > > into some other problem here? > > (in principle this should just be run like in any normal shell, right?) >=20 > Hi Erik, >=20 > So have I understood this right that you're following Eric's model and > passing an org table into a shell block whch calls python? > I.e. something like >=20 > #+begin_src sh :var tasks=3Dtasks > echo "$tasks" | python gantt.py > #+end_src >=20 > In that case it should be exactly the same as running the python code in > a shell outside emacs. To debug this, how about capturing the data > that's going into python with >=20 > #+begin_src sh :var tasks=3Dtasks > echo "$tasks" > input-data-for-python > #+end_src >=20 > and then outside emacs doing the equivalent of >=20 > python gantt.py < input-data-for-python >=20 > Does that reveal the same problem? >=20 > Dan >=20 > > > > Again any hints appreciated > > > > Erik > > > > P.S. let me stress that the code works w/o problems from a normal > > shell, since otherwise this sounds more like a python question > > > > > > On Tue, Apr 13, 2010 at 8:51 PM, Eric Schulte = wrote: > >> Erik Butz writes: > >> > >>> Hi all, > >>> > >>> I have been playing around with org-mode and have been thinking about > >>> the possibility to create gantt charts with org-mode. I did not find > >>> anything in the archives, and todays thread about taskjuggler brought > >>> me back to the subject. > >>> > >>> This is a python script hovering around the web (gantt.py) which > >>> enables gant charts with gnuplot. I played around with this a bit so > >>> as to have it accept ISO timestamps (%Y-%m-%dT%H:%M:%S) and or > >>> durations. Now I am looking for a way to execute this from within > >>> org-mode probably using org-babel > >>> > >>> The (bash) syntax would be something like > >>> > >>> python gantt.py -t "Title" -i input.txt | gnuplot -persist > >>> > >>> I would like to pass an org table to the script instead of the input > >>> file so the equivalent of doing > >>> > >>> cat input | python gantt.py -t "Title" | gnuplot -persist > >>> > >>> The input structure is (e.g.) > >>> > >>> Task 1 =C2=A0 =C2=A0 =C2=A0 =C2=A02010-4-2T12:00:00 =C2=A0 =C2=A0 =C2= =A0 1 =C2=A0 =C2=A0 =C2=A0 validate > >>> Task 2 =C2=A0 =C2=A0 =C2=A0 =C2=A02010-4-5T12:00:00 =C2=A0 =C2=A0 =C2= =A0 5.25 =C2=A0 =C2=A0 =C2=A0something > >>> Task 3 =C2=A0 =C2=A0 =C2=A0 =C2=A02010-4-5T12:00:00 =C2=A0 =C2=A0 =C2= =A0 2010-4-10T0:00:00 =C2=A0 =C2=A0 =C2=A0 otherthing > >>> Task 4 =C2=A0 =C2=A0 =C2=A0 =C2=A05.5 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 yet another thing > >>> which could well be the column mode representation of a file probably. > >>> > >> > >> something like the following in will allow you to pass a table to a > >> series of shell commands > >> > >> =C2=A0#+tblname: tasks > >> =C2=A0| Task 1 | 2010-4-2T12:00:00 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 1 | validate =C2=A0 | > >> =C2=A0| Task 2 | 2010-4-5T12:00:00 | =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A05.25 | something =C2=A0| > >> =C2=A0| Task 3 | 2010-4-5T12:00:00 | 2010-4-10T0:00:00 | otherthing | > >> > >> =C2=A0#+begin_src sh :var tasks=3Dtasks > >> =C2=A0 =C2=A0echo "$tasks" |wc > >> =C2=A0#+end_src > >> > >> =C2=A0#+results: > >> =C2=A0: 3 =C2=A0 =C2=A0 =C2=A015 =C2=A0 =C2=A0 130 > >> > >> you can also use a gnuplot block to accept the output of gantt.py, and > >> once everything is working it can be packaged up into a library of bab= el > >> [1] function which could then be called with a short line like. > >> > >> #+call: gantt(tasks=3Dmy-task-table) > >> > >> Hope that helps, let me know if you have any more questions. -- Eric > >> > >>> > >>> I am sorry should this be a bit vague. > >>> > >>> Please let me know if I can provide any more information to clarify t= he problem > >>> > >>> Cheers and thanks, > >>> > >>> Erik > >>> > >>> > >>> _______________________________________________ > >>> Emacs-orgmode mailing list > >>> Please use `Reply All' to send replies to the list. > >>> Emacs-orgmode@gnu.org > >>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > >> > >> Footnotes: > >> [1] =C2=A0http://orgmode.org/worg/org-contrib/babel/library-of-babel.p= hp > >> > >> > > > > > > _______________________________________________ > > Emacs-orgmode mailing list > > Please use `Reply All' to send replies to the list. > > Emacs-orgmode@gnu.org > > http://lists.gnu.org/mailman/listinfo/emacs-orgmode >=20 >=20 > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode >=20