ConTeXt, Charts, and transparency
(0.5,0.5,0.5) 2.5 ! Not implemented: (color)scaled(known numeric). <to be read again> ;
Dear fellow gangsters, 2 questions: QUESTION 1) Does ConTeXt have a graphical charts module, a la flowcharts module? If not, are there some examples of graphical charts done in ConTeXt anywhere? Please see the attached png for what I have in mind. I did find a module m-steps, but the enclosed example crashes, so I'm not sure if this is what I'm looking for... ============================= % output=pdf interface=en \usemodule[m-steps] % A simple paragraph-flow test: \starttext \startbuffer \startSTEPchart \cells {A} {B} \cells {one} {five} \texts{$+2$}{$-2$} \cells {two} {four} \texts{$+3$}{$-3$} \cells {three} {three} \texts{$+4$}{$-4$} \cells {four} {two} \texts{$+5$}{$-5$} \cells {five} {one} \stopSTEPchart \stopbuffer \getbuffer \startnarrower \getbuffer \stopnarrower \placefigure[left]{}{} \getbuffer \stoptext ============================= log file: ============================= (chart-test-mpgraph.mp (c:\ConTeXt\tex\texmf-local/metapost/context/base/mp-step .mp) pen_size->...epath(top.origin--bot.origin)(TEXT2); (ypart.urcorner.p-ypart.lr... set_ahlength->...:=(ahfactor*pen_size(_op_(TEXT0)) ); arrowheadonpath->...;set_ahlength(scaled.ahfactor) ;arrowhead(EXPR2)if(EXPR3)... drawline->...R2)=1:draw.arrowheadonpath((EXPR3),1) ;elseif(EXPR2)=2:draw.arro... image->...ture;currentpicture:=nullpicture;(TEXT2) ;currentpicture.endgroup l.145 ...e(2,2), 1.79993pt, (scaledgray(.5,1)) ) ) ; lines[b][2][2] := image(... ? ============================= QUESTION 2) Not really a direct context question but is needed for a context document: how can I convert the attached pdf to a transparent background without loosing the image (bitmap in origin). ImageMagick does not work well at all. I need it in a document with a colored background. Thnx in advance Best Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523 -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Idris Samawi Hamid wrote:
Dear fellow gangsters,
2 questions:
QUESTION 1) Does ConTeXt have a graphical charts module, a la flowcharts module?
Not that I know of (something looking like the png example, I mean).
QUESTION 2) Not really a direct context question but is needed for a context document: how can I convert the attached pdf to a transparent background without loosing the image (bitmap in origin). ImageMagick does not work well at all. I need it in a document with a colored background.
See attached. xpdf comes with a command called "pdfimages" that extracts bitmaps from pdf files. AFAIK, there is also a windows version. Then I used a font editor to convert the background to alpha channel in the exported bitmap. Greetings, taco
Hi Taco,
Thnx for the png conversion :-)
On Wed, 12 Jul 2006 02:56:46 -0600, Taco Hoekwater
QUESTION 1) Does ConTeXt have a graphical charts module, a la flowcharts module?
Not that I know of (something looking like the png example, I mean).
Ok, are there any suggestions for efficiently doing this kind of thing in ConTeXt/MetaPost? Thnx again Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523 -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Dear syndicate, So it's not a graphical charts module but I'm curious anyway: Could someone explain why the following sample file apparently does not work or what I am missing? :-) Best Idris
============================= % output=pdf interface=en
\usemodule[m-steps]
% A simple paragraph-flow test:
\starttext
\startbuffer \startSTEPchart \cells {A} {B} \cells {one} {five} \texts{$+2$}{$-2$} \cells {two} {four} \texts{$+3$}{$-3$} \cells {three} {three} \texts{$+4$}{$-4$} \cells {four} {two} \texts{$+5$}{$-5$} \cells {five} {one} \stopSTEPchart \stopbuffer
\getbuffer
\startnarrower \getbuffer \stopnarrower
\placefigure[left]{}{} \getbuffer
\stoptext =============================
log file:
(0.5,0.5,0.5) 2.5 ! Not implemented: (color)scaled(known numeric). <to be read again> ;
============================= (chart-test-mpgraph.mp (c:\ConTeXt\tex\texmf-local/metapost/context/base/mp-step .mp) pen_size->...epath(top.origin--bot.origin)(TEXT2); (ypart.urcorner.p-ypart.lr... set_ahlength->...:=(ahfactor*pen_size(_op_(TEXT0)) ); arrowheadonpath->...;set_ahlength(scaled.ahfactor) ;arrowhead(EXPR2)if(EXPR3)... drawline->...R2)=1:draw.arrowheadonpath((EXPR3),1) ;elseif(EXPR2)=2:draw.arro... image->...ture;currentpicture:=nullpicture;(TEXT2) ;currentpicture.endgroup l.145 ...e(2,2), 1.79993pt, (scaledgray(.5,1)) ) ) ; lines[b][2][2] := image(... ? =============================
-- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523 -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Taco Hoekwater wrote:
Idris Samawi Hamid wrote:
Dear syndicate,
So it's not a graphical charts module but I'm curious anyway: Could someone explain why the following sample file apparently does not work or what I am missing?
FWIW: Doesn't work here either.
can someone send me the test file off-list? Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Idris Samawi Hamid wrote:
Dear syndicate,
So it's not a graphical charts module but I'm curious anyway: Could someone explain why the following sample file apparently does not work or what I am missing?
did you look into m-chart (flow charts) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Fri, 14 Jul 2006 09:33:13 -0600, Hans Hagen
Idris Samawi Hamid wrote:
Dear syndicate,
So it's not a graphical charts module but I'm curious anyway: Could someone explain why the following sample file apparently does not work or what I am missing?
did you look into m-chart (flow charts)
Yes, but that seems mainly geared towards flow charts, not graphical charts. Can m-chart do things like the example png attached at the start of the thread? Best Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523 -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Idris Samawi Hamid wrote:
Yes, but that seems mainly geared towards flow charts, not graphical charts. Can m-chart do things like the example png attached at the start of the thread?
i lost that one; actually, willy egger is the most experienced chart user but he's on vacation Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen wrote:
Idris Samawi Hamid wrote:
Yes, but that seems mainly geared towards flow charts, not graphical charts. Can m-chart do things like the example png attached at the start of the thread?
i lost that one; actually, willy egger is the most experienced chart user but he's on vacation
It was more like a bar graph (with two sets of y-values), nothing to do with m-charts. I thought about mp-graph stuff, but I don't see how it can be (trivially) made to do that visual style. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Adam T. Lindsay, Computing Dept. atl@comp.lancs.ac.uk Lancaster University, InfoLab21 +44(0)1524/510.514 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
On Sat, 15 Jul 2006, Adam Lindsay wrote:
Hans Hagen wrote:
Idris Samawi Hamid wrote:
Yes, but that seems mainly geared towards flow charts, not graphical charts. Can m-chart do things like the example png attached at the start of the thread?
i lost that one; actually, willy egger is the most experienced chart user but he's on vacation
It was more like a bar graph (with two sets of y-values), nothing to do with m-charts. I thought about mp-graph stuff, but I don't see how it can be (trivially) made to do that visual style.
Have a look at http://www-math.univ-poitiers.fr/~phan/statsmac.html to see if can modify them to get the visual effect that you want. Aditya
On Tue, 18 Jul 2006 11:30:31 -0600, Aditya Mahajan
Have a look at http://www-math.univ-poitiers.fr/~phan/statsmac.html to see if can modify them to get the visual effect that you want.
Will do: Hans, Aditya, can this be ported to MetaFun or its own m-stats module? Best Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523 -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
On Tue, 18 Jul 2006, Idris Samawi Hamid wrote:
On Tue, 18 Jul 2006 11:30:31 -0600, Aditya Mahajan
wrote: Have a look at http://www-math.univ-poitiers.fr/~phan/statsmac.html to see if can modify them to get the visual effect that you want.
Will do: Hans, Aditya, can this be ported to MetaFun or its own m-stats module?
I do not use this too much. I had once tried porting metaobj to context, but found that it is easier to use raw metaobj. However, if you can come up with what you want a module to do, it is relatively straightforward to add context sugar around it. Aditya
On Tue, 18 Jul 2006, Aditya Mahajan wrote:
On Sat, 15 Jul 2006, Adam Lindsay wrote:
Hans Hagen wrote:
Idris Samawi Hamid wrote:
Yes, but that seems mainly geared towards flow charts, not graphical charts. Can m-chart do things like the example png attached at the start of the thread?
i lost that one; actually, willy egger is the most experienced chart user but he's on vacation
It was more like a bar graph (with two sets of y-values), nothing to do with m-charts. I thought about mp-graph stuff, but I don't see how it can be (trivially) made to do that visual style.
Have a look at http://www-math.univ-poitiers.fr/~phan/statsmac.html to see if can modify them to get the visual effect that you want.
There is also the ultimate reference http://zoonek.free.fr/LaTeX/Metapost/metapost.html Check out example from 285 onwards. Also, gnuplot can draw bargraphs easily. Mojca's gnuplot module is functional, so you can also give that a try. Aditya
The R module (and R program) may also be worth a look for any stats
and data visualization tasks.
Johan
2006/7/18, Aditya Mahajan
On Tue, 18 Jul 2006, Aditya Mahajan wrote:
On Sat, 15 Jul 2006, Adam Lindsay wrote:
Hans Hagen wrote:
Idris Samawi Hamid wrote:
Yes, but that seems mainly geared towards flow charts, not graphical charts. Can m-chart do things like the example png attached at the start of the thread?
i lost that one; actually, willy egger is the most experienced chart user but he's on vacation
It was more like a bar graph (with two sets of y-values), nothing to do with m-charts. I thought about mp-graph stuff, but I don't see how it can be (trivially) made to do that visual style.
Have a look at http://www-math.univ-poitiers.fr/~phan/statsmac.html to see if can modify them to get the visual effect that you want.
There is also the ultimate reference http://zoonek.free.fr/LaTeX/Metapost/metapost.html Check out example from 285 onwards.
Also, gnuplot can draw bargraphs easily. Mojca's gnuplot module is functional, so you can also give that a try.
Aditya _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
-- Johan Sandblom N8, MRC, Karolinska sjh t +46851776108 17176 Stockholm m +46735521477 Sweden "What is wanted is not the will to believe, but the will to find out, which is the exact opposite" - Bertrand Russell
On Wed, 19 Jul 2006 02:07:38 -0600, Johan Sandblom
The R module (and R program) may also be worth a look for any stats and data visualization tasks.
What is this exactly? any links? I've heard esoteric references to R on this list but have no idea what it's about ;-) Best Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523 -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
On 7/19/06, Idris Samawi Hamid wrote:
On Wed, 19 Jul 2006 02:07:38 -0600, Johan Sandblom
wrote: The R module (and R program) may also be worth a look for any stats and data visualization tasks.
What is this exactly? any links? I've heard esoteric references to R on this list but have no idea what it's about ;-)
http://www.r-project.org/ Once you manage to install it you should try texexec --demo m-r.tex The demo examples in m-r.tex are pretty good to give you an idea of what is possible. Mojca
On Tue, 18 Jul 2006 12:55:32 -0600, Aditya Mahajan
On Tue, 18 Jul 2006, Aditya Mahajan wrote:
There is also the ultimate reference http://zoonek.free.fr/LaTeX/Metapost/metapost.html Check out example from 285 onwards.
That is a nice resource; thnx for pointing it out.
Also, gnuplot can draw bargraphs easily. Mojca's gnuplot module is functional, so you can also give that a try.
Will do that as well -) Best Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523 -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
participants (7)
-
Adam Lindsay
-
Aditya Mahajan
-
Hans Hagen
-
Idris Samawi Hamid
-
Johan Sandblom
-
Mojca Miklavec
-
Taco Hoekwater