Skip to content

Latest commit

 

History

History
140 lines (107 loc) · 3.21 KB

File metadata and controls

140 lines (107 loc) · 3.21 KB

plot

$ plot [<xrange>] <function or 'datafile'> [title 'str'] [with
<style>] [pointtype n] [linetype n]

examples:

$ plot [-pi:pi] sin(x)

replot

usage is the same with plot. use this command to draw another plot
on the same graph.

splot

$ splot [<xrange>] [<yrange>] <function>

with

$ plot <...> with <style>

styles:

line						# draw with line (default)
points						# draw with points
linespoints					# draw with lines and points
boxes						# draw with boxes

linetype n					# include the color and the shape
pointtype n					# include the color and the shape
linewidth n
pointsize n

using

$ plot 'datafile' using l:m:n	
							# use colomn l m n in datafile as x y z

set

$ set <option>

options:

arrow from x1,y1 to x2,y2	# draw arraw on graph
arrow ... nohead			# draw line
border n					# border type
grid						# show grid
key							# show legend (which is default)
key right bottom outside	# set the position of legend
key x,y						# set the accurate position of legend
key box						# set the style of legend
label 'str' at x,y			# put text on x,y
mxtics n					# set number of subtics
  • output # set target file origin x,y # pos of left right corner. 0 < x,y < 1

  • size square # make unit for x = unit for y size x,y # 0 < x,y < 1 style function ... # set style of function before using plot style data ... # set style of data before using plot terminal # type of terminal

  • title 'str' # title of the graph

  • xlabel 'str' # label of x-axis

  • xrange [lo:hi] # range of x

  • xtics x # set the tics width on x-axis xtics nomirror # ? x2tics # set the upper x-axis xtics ('label1',value1,...) # set the number on x-axis dgrid3d m,n # grid number of 3d graph contour # draw contour (deng3 gao1 xian4) cntrparam levels increnental -0.9 0.1 0.9 # ?? view m,n # the point of observer when in 3d mode surface pm3d isosamples m,n

    examples:

    1. to draw on ps or eps file:

    $ set terminal post eps color solid enhanced $ set output 'graph.eps' $ plot ...

    post - postscript mode. color - needed or it will save as black and white solid - use solid lines for all plots enh - enable superscripts, subscripts, greek letters and so on

unset

opposite to set.

multiplot

set xrange [-pi:pi]
# set the size and origin before going to multiplot mode
# This sets up bounding boxes and may be required on some terminals
set size 1,1
set origin 0,0

# Done interactively, this takes gnuplot into multiplot mode
set multiplot

# left top
set size 0.5,0.5
set origin 0,0.5
plot sin(x)

# left bottom
set origin 0,0
plot 1/sin(x)

# right top
set origin 0.5,0.5
plot cos(x)

# right bottom
set origin 0.5,0  
plot 1/cos(x) 

# On some terminals, nothing gets plotted until this command is issue 
unset multiplot  
# remove all customization  
reset

abbrevations

enh		enhanced
l		line
lt		linetype
lw		linewidth
p		point
ps		pointsize
pt		pointtype
t		title
tc		titlecolor
term	terminal
w		with