![]() |
Intro to Scientific ComputingPHYS 27/193Physics Department University of the Pacific |
There are two different aspects to saving.
gnuplot> |
An easy way to do this is to "CTRL-z" out of gnuplot. This is another bit
of Unix magic.
At the gnuplot prompt,
This should pop you out of gnuplot (actually it suspends gnuplot and
gives you back your xterm prompt). At the xterm prompt, you can do
When your done looking at your file, your can bring gnuplot back by
putting it in the foreground. At the xterm prompt,
Now, you can shut down your computer, go to a concert
To see your plot again,
This should popup the graph window with your previous plot showing.
This method is used when you wish to save to gnuplot commands which
produced an individual plot. If you have done a fit, the function
which you have defined will be in the saved file, along with the
"best fit" parameters which were found. Note that when you do a
fit, gnuplot saves a complete log in the file "fit.log".
Only the log of the last fit is saved however.
This will create a (possibly long) file called "mysession.gp" with all
the commands you have typed into gnuplot. If you view this file in
less, you can read what you had been doing, and cut/paste commands
into gnuplot to redo the things you want.
Gnuplot has many different Terminals for which it can
produce plots. Since gnuplot has been around for 20 years, several of these
are outdated. However, a few are quite useful; the PDF "terminal"
is one of these, for example.
To see all the terminal types, do
To use one of these terminal types, you start gnuplot and get plot what you want.
After you have the plot looing the way you want it to,
The last line above, set terminal pop, returns the terminal type to the one that was
set when gnuplot stated.
GIF and JPEG files are useful for including other documents such as HTML web pages or MS Word documents.
There simplest method to Print a Plot is to just produce a PDF file as described
above, find the file with a PDF Reader, and print the file from the Reader.
So, are you ready to put all this together? Here's Homework 6
and come back to your scientific work tomorrow.
gnuplot>
Remember that all file or directory names must be enclosed in
""s.
Saving your entire gnuplot session
As we did in HW 5,
if you want to save a complete record of all the commands you have typed
during your session, you can do the following:
gnuplot>
Saving a plot as an image
Another very useful save method is to "write the plot in a
different format, for example as a GIF graphics file.
gnuplot>
as if you were going to set the terminal to some type. But just type ENTER instead.
This will list all the possible terminal types. I've highlighted common ones below:
Available terminal types:
aed512 AED 512 Terminal
aed767 AED 767 Terminal
aifm Adobe Illustrator 3.0 Format
bitgraph BBN Bitgraph Terminal
cgm Computer Graphics Metafile
corel EPS format for CorelDRAW
dumb ascii art for anything that prints text
dxf dxf-file for AutoCad (default size 120x80)
eepic EEPIC -- extended LaTeX picture environment
emf Enhanced Metafile format
emtex LaTeX picture environment with emTeX specials
epslatex LaTeX picture environment using graphicx package
epson_180dpi Epson LQ-style 180-dot per inch (24 pin) printers
epson_60dpi Epson-style 60-dot per inch printers
epson_lx800 Epson LX-800, Star NL-10, NX-1000, PROPRINTER ...
fig FIG graphics language for XFIG graphics editor
gif GIF images using libgd and TrueType fonts
gpic GPIC -- Produce graphs in groff using the gpic preprocessor
hp2623A HP2623A and maybe others
hp2648 HP2648 and HP2647
hp500c HP DeskJet 500c, [75 100 150 300] [rle tiff]
hpdj HP DeskJet 500, [75 100 150 300]
hpgl HP7475 and relatives [number of pens] [eject]
hpljii HP Laserjet series II, [75 100 150 300]
hppj HP PaintJet and HP3630 [FNT5X9 FNT9X17 FNT13X25]
imagen Imagen laser printer
jpeg JPEG images using libgd and TrueType fonts
kc_tek40xx MS-DOS Kermit Tek4010 terminal emulator - color
km_tek40xx MS-DOS Kermit Tek4010 terminal emulator - monochrome
latex LaTeX picture environment
mf Metafont plotting standard
mif Frame maker MIF 3.00 format
mp MetaPost plotting standard
nec_cp6 NEC printer CP6, Epson LQ-800 [monocrome color draft]
okidata OKIDATA 320/321 Standard
pbm Portable bitmap [small medium large] [monochrome gray color]
pcl5 HP Designjet 750C, HP Laserjet III/IV, etc. (many options)
pdf PDF (Portable Document File) file driver
png PNG images using libgd and TrueType fonts
postscript PostScript graphics, including EPSF embedded files (*.eps)
pslatex LaTeX picture environment with PostScript \specials
pstex plain TeX with PostScript \specials
pstricks LaTeX picture environment with PSTricks macros
qms QMS/QUIC Laser printer (also Talaris 1200 and others)
regis REGIS graphics language
rgip RGIP metafile (Uniplex). Option: fontsize (1-8)
selanar Selanar
starc Star Color Printer
svg W3C Scalable Vector Graphics driver
tandy_60dpi Tandy DMP-130 series 60-dot per inch graphics
tek40xx Tektronix 4010 and others; most TEK emulators
tek410x Tektronix 4106, 4107, 4109 and 420X terminals
texdraw LaTeX texdraw environment
tgif TGIF X11 [mode] [x,y] [dashed] ["font" [fontsize]]
tkcanvas Tk/Tcl canvas widget [perltk] [interactive]
tpic TPIC -- LaTeX picture environment with tpic \specials
uniplex RGIP metafile (Uniplex). Option: fontsize (1-8) (Same as rgip)
unknown Unknown terminal type - not a plotting device
vttek VT-like tek40xx terminal emulator
x11 X11 Window System
xlib X11 Window System (gnulib_x11 dump)
This is what you get by typing the set term command.
you can produce a GIF image of your plot by doing the following:
gnuplot>
You can now include this image in a document or webpage, or send it to a collaborator via
email.
Another very popular file format
You can make a PDF file of your plot by following the steps
above, but using pdf instead of gif.
gnuplot>
You'll need to send me a PDF plot later, and we'll use JPEG plots in LaTeX.
Printing your Plots
The methods above are almost enough to do everything, but there are
times when you just need to send your Mom a copy of some really
interesting work that you've recently done, so she can put it on the
'fridge to display for her friends.