On Sat, Apr 4, 2009 at 19:42, Ethan A Merritt wrote:
>> I would like to create a terminal that would combine some "pixel"
>> terminal with a TeX terminal. The same has been done with epslatex
>> where PS takes care for graphical part of the plot and TeX is used for
>> generating labels. I would like to do the same, but in the way that
>> drawing pixel data is delegated to some third terminal that generates
>> a PNG figure (could be GD or pango or whatever) and TeX labels are
>> handled with the TeX terminal. TeX would then include the generated
>> PNG image and draw true labels on top of image.
>
> Here is another suggestion for how one might do it:
>
> 1) Create a latex terminal variant that simply assumes that the graphics
> part of the plot already exists. The current CVS code stores
> relevant information about plot boundaries and axis scaling from the
> previous plot, so it should be possible to place all the text elements
> appropriately.
Wow! That's indeed a great suggestion. There's only one tiny, but
important question: font sizes. How can I convince "the other" (pixel)
terminal to assume the same label sizes than the ones that TeX
terminal uses?
For example, I could alreadyuse (pseudocode):
set term png withtransparentlabels
set output "bla.png"
plot sin(x)
set term context/latex includethegraphics "bla.png" font "iwona,8"
set output "bla.tex"
plot sin(x)
but I'm afraid that if I align the borders of the two plots, the
graphics themselves won't align nicely because different label sizes
are used to generate the plots.
This means that it's not straight-forward to do it; it needs some
tweaking of font sizes, but I really like the idea and it should not
be too difficult to do. I'll take a look and come back.
> 2) Teach one or more of the other terminals (gd, cairo, post) to accept
> a terminal option to draw all text invisibly.
>
> 3) Perhaps introduce a new top-level command that runs the plot through
> these two drivers sequentially. Doing it manually should be easy
> enough, however.
>
> Something of the sort would also be useful for the svg and canvas
> terminals, whose respective output languages are not well suited for
> direct representation of pixel images. Instead they expect to be able
> to refer to a PNG image in the appropriate position, similar to the
> way latex can embed an eps or pdf image.
>
>> My main question is: how difficult is the configuration process that
>> needs to be done in the background? I know a bit about programming and
>> managed to write a terminal that works OK, but I don't understand a
>> bit about configuring the bits and pieces, so that the code compiles
>> properly when using different libraries.
>
> Are you thinking of the autoconf tools?
> They are indeed a nightmare. But I would not worry about that until you
> actually have a new terminal ready to go. What new libraries did you
> have in mind?
No new libraries. I just don't have any experience with external
libraries and their configuration. If GD library is already configured
properly, I guess that it should already work.
Mojca
Below are just my explanations (no need to argue on them, they are all
relative).
On Sat, Apr 4, 2009 at 19:42, Ethan A Merritt wrote:
> On Saturday 04 April 2009, Mojca Miklavec wrote:
>> Hello,
>>
>> I'm using gnuplot a lot for different kinds of graphs. I'm mostly
>> using the TeX terminal (my own one, ConTeXt), but as soon as one wants
>> to draw a complicated graphic (it's enough to request this:
>> http://gnuplot.sourceforge.net/demo_4.3/pm3d.8.png) the following
>> happens:
>> - TeX runs out of memmory very quickly
>> - even if TeX manages to process the graphic, desplaying it becomes
>> extremely slow if you ask any PS/PDF viewer to display one million
>> points or lines; it needs to draw every line separately even if most
>> of them are hidden
>
> Conclusion:
> TeX is very bad at graphics. That is not what it was designed for.
> It is the wrong tool for the job.
That's both true and false. The old good TeX is very bad for graphics,
but when talking about ConTeXt and TikZ as macro packages, or in
particular about LuaTeX that has metapost built in ... TeX becomes
almost as powerful as PS/PDF.
The graphics generated by ConTeXt or TikZ terminal are of satisfactory
quality (comparable to that of other terminals) as long as we're
talking about 2D. 3D is indeed problematic, but too dense mesh causes
problems to PS/PDF as well.
But I don't want to argue whether TeX is suitable or not. As long as
it does the job well for me, I'm happy with it even if others are not.
>> If I use GD terminal, then I'm very limited with the labels I use (I
>> cannot use TeX tricks on them, the fonts don't scale, switching fonts
>> is very complicated and not too much platform-independent; I'm
>> copiling my documents on multiple platforms) etc. etc.
>
> I do not understand these comments. The fonts are indeed scalable,
Yes, the fonts are scalable, I can get smaller or bigger fonts, but
once the labels are written to PNG file, one cannot zoom into the plot
and get arbitrary scaled version of the label any more. I prefer all
the labels in my documents to be scalable (in vector format).
(One side of the truth is that I still have some problems with gd
terminal, but that's another issue. Do not bother about it.)
> and are entirely platform-independent,
True, the font is platform-independent, but I need to tell gnuplot
where some font resides. And that information is not
platform-independent unless I put a copy of the font in folder when I
compile graphics. I need to figure out how to play with fonts inside
GD terminal (the main reason why I didn't do that until now is that
TeX more or less satisfies my needs except in some weird cases).
Another problem is that TeX is more powerful and (for me personally)
much easier to use when talking about placing labels with math
expressions. Again - I would not like to argue about it. Everyone has
its own preferences and this one is one of them.
> moreso than LaTeX fonts are
> since only the original machine, not the viewing machine, needs to
> have the fonts installed.
True, but I sometimes need to compile graphics on different machines.
I compile gnuplot graphics on the same machine where I compile TeX
graphics, so "viewing machine" and "original machine" imply "the same
different machines" in my case.
> In either case you have to have the support
> package installed (TeX in one case, libgd in the other).
I'm aware of that. I don't have problems installing TeX, though
configuring all the libraries to compile gnuplot properly may
sometimes be painful. But I can live with that.
|