gcalderone/Gnuplot.jl

pdflatex terminal produces zero-size output file

PetrKryslUCSD opened this issue · 3 comments

The following code

@gp  "reset" :-

        @gp  :- "set terminal cairolatex standalone pdf size 16cm,10.5cm " :-
        @gp  :- "set output 'fire_severity1.tex' "  :-
        # @gp "clear"
        @gp "set key top left box  font \"Times-Roman\"" :-
        @gp  :- reference_Bathe[:, 1] reference_Bathe[:, 2] " lw 2 lc rgb 'black' with points title 'Bathe' "  :-
        @gp  :- reference_Belytschko[:, 1] reference_Belytschko[:, 2] " lw 2 lc rgb 'black' with points title 'Belytschko' "  :-
        @gp  :- reference_Tabiei[:, 1] reference_Tabiei[:, 2] " lw 2 lc rgb 'black' with points title 'Tabiei' "  :-
        @gp  :- collect(0.0:dt:(nsteps*dt))/phun("Milli*s")  cdeflections/phun("in") " lw 2 lc rgb '$color' with lines title 'Deflection at the center' "  :-

        @gp  :- "set tics font \"Times-Roman\"" :-
        @gp  :- "set xlabel 'Time [ms]' font \"Times-Roman\"" :-
        @gp  :- "set ylabel 'Deflection [in]' font \"Times-Roman\"" :-
        @gp  :- "set title 'Spherical cap' font \"Times-Roman\""
        @gp  :- "set output "  

produces a figure onscreen, and a file is also written, but the file has zero size.
Is this perhaps some interaction of the package with gnuplot?

Yes. Gnuplot.jl manages values of terminal and output variables itself and calls reset when appropriate. I think that what you need is this:

@gp "set key top left box  font \"Times-Roman\"" :-
@gp  :- reference_Bathe[:, 1] reference_Bathe[:, 2] " lw 2 lc rgb 'black' with points title 'Bathe' "  :-
@gp  :- reference_Belytschko[:, 1] reference_Belytschko[:, 2] " lw 2 lc rgb 'black' with points title 'Belytschko' "  :-
@gp  :- reference_Tabiei[:, 1] reference_Tabiei[:, 2] " lw 2 lc rgb 'black' with points title 'Tabiei' "  :-
@gp  :- collect(0.0:dt:(nsteps*dt))/phun("Milli*s")  cdeflections/phun("in") " lw 2 lc rgb '$color' with lines title 'Deflection at the center' "  :-

@gp  :- "set tics font \"Times-Roman\"" :-
@gp  :- "set xlabel 'Time [ms]' font \"Times-Roman\"" :-
@gp  :- "set ylabel 'Deflection [in]' font \"Times-Roman\"" :-
@gp  :- "set title 'Spherical cap' font \"Times-Roman\""
Gnuplot.save(term="cairolatex standalone pdf size 16cm,10.5cm", output="fire_severity1.tex")

Thanks! Gnuplot.save... works very well.

Thanks @wentasah !!!