From: <wa...@ga...> - 2004-06-05 23:11:06
|
Hi, I am trying to use the metapost terminal to produce a bar chart (boxes). One of the several problems I have is that despite that style solid is on, metapost term just outputs line drawing. I looked into the generated code and apparently right metapost fill commands are note generated at all. So I grabbed the CVS release of gnuplot and it does not seem that there is any difference in there. Since I got the code it was pretty easy to find the actual terminal file and patch it slightly: --- term/metapost.trm 2004-04-13 19:24:34.000000000 +0200 +++ ../gnuplot--mydev/term/metapost.trm 2004-06-05 22:56:44.833836616 +0200 @@ -799,22 +799,29 @@ TERM_PUBLIC void MP_boxfill(sty, x1, y1, wd, ht) int sty; unsigned int x1, y1, wd, ht; { /* for now simply clear box if sty <= 0, do nothing otherwise */ if (MP_inline) MP_endline(); - if (sty <= 0) + if (sty <= 0) { fprintf(gpoutfile, "\ fill (%.1fa,%.1fb)--(%.1fa,%.1fb)--(%.1fa,%.1fb)--(%.1fa,%.1fb)--cycle withcolor background;\n", x1 / 10.0, y1 / 10.0, (x1 + wd) / 10.0, y1 / 10.0, (x1 + wd) / 10.0, (y1 + ht) / 10.0, x1 / 10.0, (y1 + ht) / 10.0); + } else { + fprintf(gpoutfile, "\ +fill (%.1fa,%.1fb)--(%.1fa,%.1fb)--(%.1fa,%.1fb)--(%.1fa,%.1fb)--cycle withpen (pencircle scaled 0pt);\n", + x1 / 10.0, y1 / 10.0, (x1 + wd) / 10.0, y1 / 10.0, + (x1 + wd) / 10.0, (y1 + ht) / 10.0, x1 / 10.0, + (y1 + ht) / 10.0); + } } This version produces excellent boxes plots (in fact metapost processed gnuplot graphs are so much more beatiful than those produced with postscript term directly!). My question is: why is this not implemented this way? The original maintainer might have a good reason (see the comment: "do nothing otherwise"). I am not a gnuplot developer, so I have no clue if this things breakes anything in other with-styles etc. Andrzej |