Question

How to "export" a graph to png or something insertable in Word ? I know there are a dozen tutorials for this on the 'net, but I'm having trouble just finding a simple example.

Was it helpful?

Solution

Follow these;

Once you are happy with your plot, set your output terminal type to ``Postscript.''

gnuplot> set terminal postscript

Graphics will be written in Postscript format, the language understood by our printers, instead of the format understood by the windowing system. Then specify a file name for your postscript output.

gnuplot> set output 'myfile.ps'

Then write your plot to the file by replotting.

gnuplot> replot

To send your Postscript file to the printer, use the lpr shell command, (OPTIONAL)

$ lpr myfile.ps

If you would like to continue working with your plot in a graphics window, you will need to return the output and terminal settings to normal by typing

gnuplot> set terminal x11

gnuplot> set output

A great tutorial is here

OTHER TIPS

On windows, you can

set terminal windows

for the output to a window. Next for png output,

set terminal png

This should work on the native windows gnuplot binary.

Write

set terminal pngcairo
set output output.png

And gnuplot should write to a file called output.png.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top