Alexiades - UTK
How to Print Plots from Gnuplot and line types
Such things can be done much more efficiently and conveniently using
scripts... see my
gplot scripts...
1. Producing postscript (.ps)
First you prepare your plot as you want it in gnuplot. Then:
gnuplot> set term postscript (will produce postscript output)
gnuplot> set output "printme.ps" (output to any filename.ps you want)
gnuplot> replot (recreates plot but you don't see it, goes to file)
gnuplot> set term x11 on unix or: set term win on win
(resets the normal terminal so you can do more plotting)
Now you have a postscript file named printme.ps containing your plot.
On UNIX: you can view it with: gs printme.ps or ghostview printme.ps
or produce .pdf: ps2pdf printme.ps printme.pdf
On WIN : you can view it with GSview (may need to install it)
On MAC: you can view it with preview
NOTE: A full specification for .ps that sets font size etc is:
set term postscript landscape enhanced color dashed "Helvetica" 14
2. Producing png (image file, similar to .jpg)
gnuplot> set term png (will produce .png output)
gnuplot> set output "printme.png" (output to any filename.png you want)
gnuplot> replot
gnuplot> set term x11
You can view it with some viewer, or on a browser, or print it...
or import it in PowerPoint or whatever you want to do with it.
3. Gnuplot colors
Line type and line width are specified by lt and lw.
With set term postscript dashed, types are:
lt: −1 :black(solid), 0 :black(dashed,faint), 1 :red(solid), 2 :green(dashed), 3 :blue(dashed), 4 :magenta(dashed), 5 :cyan, 6 :yellow(hard to see)
lw: 1 (thin), 2 , 3 , ...
Good combinations: lt −1 lw 2 ,
lt 1 lw 2 , lt 2 lw 3 ,
lt 3 lw 3 , lt 4 lw 4
With set term postscript solid , OR
with set term png, same colors but all are solid lines.