[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pdflatex + gnuplot?
From: |
Ben Abbott |
Subject: |
Re: pdflatex + gnuplot? |
Date: |
Wed, 26 Sep 2012 17:47:56 -0400 |
On Sep 26, 2012, at 5:23 PM, Leo Butler wrote:
> Ben Abbott <address@hidden> writes:
>
>> On Sep 26, 2012, at 4:01 PM, Leo Butler wrote:
>>
>>> I am using octave 3.6.2 and gnuplot 4.6.0, both from debian testing. The
>>> documentation for print states
>>>
>>> ,----
>>> | `pdflatex'
>>> | Generate a LaTeX (or TeX) file for labels, and eps/ps/pdf
>>> | for graphics. The file produced by `epslatexstandalone'
>>> | can be processed directly by LaTeX. The other formats
>>> | are intended to be included in a LaTeX (or TeX)
>>> | document. The `tex' device is the same as the
>>> | `epslatex' device. The `pdflatex' device is only
>>> | available for the FLTK graphics toolkit.
>>> `----
>>>
>>> The cairolatex terminal is capable of generating nice pdf/eps+latex
>>> files, with the only change in code being eps -> pdf.
>>>
>>> I realize that octave provides an abstraction layer above gnuplot/fltk,
>>> but perhaps there is some really easy way to implement this in octave as
>>> it stands without patching code? Am I right- or wrong-headed?
>>>
>>> Leo
>>
>> You can use the drawnow() function to output a gnuplot plot-stream and then
>> modify the plot-stream to use the cairolatex. I haven't tested the
>> instructions below, so some modification may be needed.
>>
>> (1) Produce your plot
>> (2) drawnow ("x11", "/dev/null", false, "plotstream.gp")
>> (3) Edit plotstream.gp and change "set term x11..." to "set term cairolatex
>> ...", also specify a new output file.
>> (4) Run gnuplot and load plotstream.gp
>>
>> Ben
>
> That does work, thanks.
>
> Is it possible to direct the gnuplot plot-stream to a string? I don't
> know how to rebind stdout in octave.
>
> Leo
I don't think so. But you can read the result using fread (or another i/o
function).
Ben