[NTG-context] gnuplot for Mojca

Mojca Miklavec mojca.miklavec.lists at gmail.com
Tue Jan 3 21:27:54 CET 2006

On 1/3/06, Peter Münster wrote:
> On Tue, 3 Jan 2006, Mojca Miklavec wrote:
> > Thanks a lot. I've learnt a lot from the example, it's only that in
> > the way it's written now it's not compatible with windows.
> Hello Mojca,
> if you are using Windows, you can install MinGW, it's free and bash is
> included.

OK, that could be file for me and maybe for two others, but this can't
be a general solution. (Beginners wouldn't install it and the skilled
ones have linux anyway.)

So my question for gurus remains: how to write a macro, so that

set title "trigonometry"
plot sin(x)
plot cos(x)

would result in one file with

set terminal postscript
set output "filename1"
set title "trigonometry"
plot sin(x)

and the other one with

set terminal postscript
set output "filename2" # If too complicated, the filename may remain the same
set title "trigonometry"
plot cos(x)

Out of curiosity: does "metafun" check if the buffers were changed, so
that compiling again the same file is skipped next time?
(For a little module as this one it's too little gain for too much anyway.)

> > Gnuplot would also need some kind of \startGnuplotinclusions for stuff like
> >     set nokey
> >     set xlabel "time"
> > plus the lines for setting the terminal which would automatically be added.
> or something like \setupGnuplot with keys=vals!

Well, ... yes. That also, of course. Those could be use to set engine
to postscript/eps/metapost/png/... or even LaTeX. (But for the
beginning, I would be greatful for even the dummiest possible

If ConTeXt terminal would be written, maybe this could be used also
for setting symbols, default colors, ... etc.

> > (I don't like the postscript terminal itself, but that module s a good start.)
> At least, it's not bitmap.

I use LaTeX as the terminal otherwise (but your module can be
modoified to use LaTeX terminal and convert into PDF as well).

If I will find some time and additional motivation (sorry, less
motivation for other things), I would like to modify the
"metapost.trm". It's only 1000 lines (postscript is a bit longer), but
very well structured code and much better understandable than TeX
which is still cryptography for me. (Even in that case I would still
need a lot of help from the ConTeXt side.)

> But there is a white border around the plot. It
> would be nice to have a clipping-option in \externalfigure.

I would prefer to leave the border in this case as the default
behaviour (for example if you have two graphs with different labels,
you want the graphs to have the same size, not cropped because of
slightly different name for the y axis), but I vote for that feature
too. (Hans?)

Some time ago Hans mentioned that texexec can crop, but I didn't
manage to make it work (it was converting from PDF to PS and back, but
it didn't crop anything). There's a nice working script on CTAN
(http://www.ctan.org/tex-archive/support/pdfcrop/) for cropping. I
guess that texexec could do that as well, but some half year ago as I
tried it, I had no luck.

Thanks again for all that,

More information about the ntg-context mailing list