Any of the above plotting utilities can also be used for directly plotting
into eps
or png
files, or pdf
files if your gnuplot installation
allows. A final gnuplot.plotflush() command ensures that all output is
written to the file properly.
gnuplot.epsfigure('test.eps')
gnuplot.plot({'Sin Curve',torch.sin(torch.linspace(-5,5))})
gnuplot.xlabel('X')
gnuplot.ylabel('Y')
gnuplot.plotflush()
Creates a figure directly on the eps
file given with
fname
. This uses Gnuplot
terminal postscript eps enhanced color
.
Only available if your installation of gnuplot has been compiled
with pdf
support enabled.
Creates a figure directly on the pdf
file given with
fname
. This uses Gnuplot
terminal pdf enhanced color
,
or pdfcairo enhanced color
if available.
Creates a figure directly on the png
file given with
fname
. This uses Gnuplot
terminal png
, or pngcairo
if available.
Creates a figure directly on the svg
file given with fname
. This uses
Gnuplot
terminal svg
.
Prints the current figure to the given file with name fname
. Only png
or eps
files are supported by default. If your gnuplot installation
allows, pdf
files are also supported.
This command sends unset output
to underlying gnuplot. Useful for
flushing file based terminals.
Closes open file handles. Prevents too many handles staying open if creating lots of plots.