• How to produce screenplot and pslatex-plot with one batch file

    From hugocoolens@gmail.com@21:1/5 to All on Thu Jul 8 07:30:46 2021
    I currently use Gnuplot as follows:
    I write a batch-file myfile.gp with the following commands in comment
    #set terminal pslatex size 25cm,17cm monochrome
    #set output "fileforlatex.tex"

    I first run the batch file to see if plot is OK on screen, like this
    gnuplot <myfile.gp --persist
    If the result seems OK, I edit the original batch file and remove the #
    such that I have:
    set terminal pslatex size 25cm,17cm monochrome
    set output "fileforlatex.tex"

    The I rerun Gnuplot:
    gnuplot <myfile.gp

    I wonder whether it is possible to see the result on screen _and_ produce the fileforlatex.tex at the same time?

    Here is a trivial example batch file: myfile.gp:
    #set terminal pslatex size 25cm,17cm monochrome
    #set output "fileforlatex.tex"
    plot sin(x)
    set output


    kind regards,
    Hugo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gavin Buxton@21:1/5 to All on Fri Jul 9 08:18:39 2021
    Hi

    I might be misunderstanding your question, but it seems like you want to see the output of your plot when the terminal is tex. I usually use ps or png files and then embed them in latex afterwards, so I would check it using something like:

    set term post
    set output 'temp.ps'
    plot sin(x)
    set output
    !gv temp.ps

    where the last command would open the file using ghostview (the exclamation mark just allows you to run external programs from gnuplot commandline). I don't use tex file directly, but I imagine to view the tex file you would need an external viewer of
    some kind?

    Best


    Gavin

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From hugocoolens@gmail.com@21:1/5 to Gavin Buxton on Sat Jul 10 02:23:43 2021
    On Friday, July 9, 2021 at 5:18:40 PM UTC+2, Gavin Buxton wrote:
    Hi

    I might be misunderstanding your question, but it seems like you want to see the output of your plot when the terminal is tex. I usually use ps or png files and then embed them in latex afterwards, so I would check it using something like:

    set term post
    set output 'temp.ps'
    plot sin(x)
    set output
    !gv temp.ps

    where the last command would open the file using ghostview (the exclamation mark just allows you to run external programs from gnuplot commandline). I don't use tex file directly, but I imagine to view the tex file you would need an external viewer of
    some kind?

    Best


    Gavin
    Dear Gavin,
    Thanks for your answer but this is not what I want. I really want pslatex output as that gives nicer graphs than plain postscript. What I want is a default screen plot _and_ a pslatex-file all in one script.
    Maybe someone else has a suggestion?

    kind regards,
    Hugo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Gavin Buxton@21:1/5 to All on Sat Jul 10 08:07:25 2021
    Ah, I think I see now. You could

    set terminal pslatex size 25cm,17cm monochrome
    set output "fileforlatex.tex"
    plot sin(x)
    set output
    set term x11
    rep

    and just plot it again to the screen, but it might not look the same in a different terminal.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From hugocoolens@gmail.com@21:1/5 to Gavin Buxton on Tue Jul 13 04:53:54 2021
    On Saturday, July 10, 2021 at 5:07:26 PM UTC+2, Gavin Buxton wrote:
    Ah, I think I see now. You could
    set terminal pslatex size 25cm,17cm monochrome
    set output "fileforlatex.tex"
    plot sin(x)
    set output
    set term x11
    rep

    and just plot it again to the screen, but it might not look the same in a different terminal.
    Dear Gavin,
    This is exactly what I needed. It makes my workflow a lot more efficient because when I see the plot looks OK on the screen I can now immediately start LaTeX, otherwise I always had to put those two lines in comment and rerun Gnuplot an extra time to
    produce the LaTeX picture.
    Thanks a lot and kind regards,
    Hugo

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)