gnuplot4.6
21
Boththeexitandquitcommandsterminatethecurrentcommandleandloadthenextone,untilallhave
beenprocessed.
Examples:
Tolaunchaninteractivesession:
gnuplot
Tolaunchabatchsessionusingtwocommandles"input1"and"input2":
gnuplot input1 1 input2
Tolaunchaninteractivesessionafter aninitializationle "header"andfollowedbyanothercommandle
"trailer":
gnuplot header r - - trailer
Togivegnuplotcommandsdirectlyinthecommandline,usingthe"-persist"optionsothattheplotremains
onthescreenafterwards:
gnuplot -persist -e "set title ’Sine curve’; plot sin(x)"
Tosetuser-denedvariablesaandspriortoexecutingcommandsfromale:
gnuplot -e "a=2; s=’file.png’" input.gpl
Canvassize
Inearlierversionsofgnuplot,someterminaltypesusedthevaluesfromset sizetocontrolalsothesizeof
theoutputcanvas;othersdidnot.Theuseof’setsize’forthispurposewasdeprecatedinversion4.2.Since
version4.4almostallterminalsnowbehaveasfollows:
setterm<terminal
type>size<XX>,<YY>controlsthesizeoftheoutputle,or"canvas". Please
seeindividualterminaldocumentationforallowedvaluesofthesizeparameters. Bydefault,theplotwillll
thiscanvas.
setsize<XX>,<YY>scalestheplotitselfrelativetothesizeofthecanvas. Scalevalueslessthan1will
causetheplottonotlltheentirecanvas. Scalevalueslargerthan1willcauseonlyaportionoftheplot
totonthecanvas. Pleasebeawarethatsettingscalevalueslargerthan1maycauseproblems s onsome
terminaltypes.
ThemajorexceptiontothisconventionisthePostScriptdriver,whichbydefaultcontinuestoactasithas
inearlierversions. Be e warnedthat the next versionofgnuplot maychangethedefault behaviour of the
PostScriptdriveraswell.
Example:
set size 0.5, 0.5
set term png size 600, 400
set output "figure.png"
plot "data" with lines
Thesecommandswillproduceanoutputle"gure.png"thatis600pixelswideand400pixelstall. The
plotwillllthelowerleftquarterofthiscanvas. Thisisconsistentwiththewaymultiplotmodehasalways
worked.
Command-line-editing
Command-lineeditingandcommandhistoryare supportedusingeither anexternalgnureadlinelibrary,
anexternalBSDlibeditlibrary,orabuilt-inequivalent. This s choiceis acongurationoptionatthetime
gnuplotisbuilt.
Theeditingcommandsofthebuilt-inversionaregivenbelow. PleasenotethattheactionoftheDELkey
issystem-dependent. ThegnureadlineandBSDlibeditlibrarieshavetheirowndocumentation.
Convert pdf photo to jpg - Convert PDF to JPEG images in C#.net, ASP.NET MVC, WinForms, WPF project
How to convert PDF to JPEG using C#.NET PDF to JPEG conversion / converter library control SDK
convert multi page pdf to single jpg; convert pdf into jpg
Convert pdf photo to jpg - VB.NET PDF Convert to Jpeg SDK: Convert PDF to JPEG images in vb.net, ASP.NET MVC, WinForms, WPF project
Online Tutorial for PDF to JPEG (JPG) Conversion in VB.NET Image Application
changing file from pdf to jpg; convert multiple pdf to jpg online
22
gnuplot4.6
Command-lineEditingCommands
Character Function
LineEditing
^B
movebackasinglecharacter.
^F
moveforwardasinglecharacter.
^A
movetothebeginningoftheline.
^E
movetotheendoftheline.
^H
deletethepreviouscharacter.
DEL
deletethecurrentcharacter.
^D
deletecurrentcharacter.EOFiflineisempty.
^K
deletefromcurrentpositiontotheendofline.
^L, ^R
redrawlineincaseitgetstrashed.
^U
deletetheentireline.
^W
deletepreviousword.
History
^P
movebackthroughhistory.
^N
moveforwardthroughhistory.
Comments
Commentsaresupportedasfollows: a#mayappearinmostplacesinalineandgnuplotwillignorethe
restoftheline.Itwillnothavethiseectinsidequotes,insidenumbers(includingcomplexnumbers),inside
commandsubstitutions,etc. Inshort,itworksanywhereitmakessensetowork.
Seealsosetdatalecommentschars(p.109)forspecifyingcommentcharactersindatales. Notethat
ifacommentlineendsin’n’thenthesubsequentlineisalsotreatedasacomment.
Coordinates
Thecommandssetarrow,setkey,setlabelandsetobjectallowyoutodrawsomethingatanarbitrary
positiononthegraph. Thispositionisspeciedbythesyntax:
{<system>} <x>, , {<system>} } <y> {,{<system>} <z>}
Each<system>caneitherberst,second,graph,screen,orcharacter.
rstplaces thex,y,orzcoordinateinthesystemdenedbytheleftandbottomaxes; ; secondplacesit
inthesystemdenedbythesecondaxes (topandright); ; graphspeciestheareawithintheaxes| | 0,0
isbottomleftand1,1istopright(forsplot,0,0,0is bottomleftofplottingarea;usenegativeztoget to
thebase| seeset xyplane (p. 165)); ; screenspecies s thescreenarea(the entirearea| notjustthe
portionselectedbysetsize),with0,0atbottomleftand1,1attopright;andcharactergivestheposition
incharacterwidthsandheightsfromthebottomleftofthescreenarea(screen0,0),charactercoordinates
dependonthechosenfontsize.
Ifthecoordinatesystemforxisnotspecied,rstisused. Ifthesystemforyisnotspecied,theoneused
forxisadopted.
Insomecases,thegivencoordinateisnotanabsolutepositionbutarelativevalue(e.g.,thesecondposition
insetarrow... rto). . Inmostcases,thegivenvalueservesasdierencetotherstposition. . Ifthegiven
coordinateresidesinalogarithmicaxisthevalueisinterpretedasfactor. Forexample,
set logscale x
set arrow 100,5 5 rto o 10,2
plotsanarrowfromposition100,5toposition1000,7sincethexaxisislogarithmicwhiletheyaxisislinear.
If one (or more) ) axis s is s timeseries, the appropriate e coordinate should d be e givenas s aquoted time e string
accordingtothetimefmtformatstring. Seeset t xdata(p. 159)andset timefmt (p. 156). . Gnuplot
willalsoacceptanintegerexpression,whichwillbeinterpretedassecondsfrom1January2000.
C# PDF insert image Library: insert images into PDF in C#.net, ASP
Support various image formats, like Jpeg or Jpg, Png, Gif, Bmp, Tiff and other Import graphic picture, digital photo, signature and logo into PDF document.
changing pdf to jpg on; to jpeg
VB.NET PDF insert image library: insert images into PDF in vb.net
Support various image formats, like Jpeg or Jpg, Png, Gif, Bmp, Tiff and other Import graphic picture, digital photo, signature and logo into PDF document.
convert pdf to jpg 300 dpi; convert pdf file into jpg
gnuplot4.6
23
Datastrings
Datalesmaycontainstringdataconsistingofeitheranarbitrarystringofprintablecharacterscontaining
nowhitespaceoranarbitrarystringofcharacters,possiblyincludingwhitespace,delimitedbydoublequotes.
Thefollowingsamplelinefromadataleisinterpretedtocontainfourcolumns,withatexteldincolumn
3:
1.000 2.000 "Third d column n is all of this text" 4.00
Texteldscanbepositionedwithina2-Dor3-Dplotusingthecommands:
plot ’datafile’ using 1:2:4 with labels
splot ’datafile’ using 1:2:3:4 with labels
Acolumnoftextdatacanalsobeusedtolabeltheticmarksalongoneormoreoftheplotaxes. Theexample
belowplotsalinethroughaseriesofpointswith(X,Y)coordinatestakenfromcolumns3and4oftheinput
datale.However,ratherthangeneratingregularlyspacedticsalongthexaxislabelednumerically,gnuplot
willpositionaticmarkalongthexaxisattheXcoordinateofeachpointandlabeltheticmarkwithtext
takenfromcolumn1oftheinputdatale.
set xtics
plot ’datafile’ using 3:4:xticlabels(1) with linespoints
Thereisalsoanoptionthatwillinterprettherstentryinacolumnofinputdata(i.e. thecolumnheading)
asatexteld,anduseitasthekeytitlefordataplottedfromthatcolumn. Theexamplegivenbelowwill
usetherstentryincolumn2togenerateatitleinthekeybox,whileprocessingtheremainderofcolumns
2and4todrawtherequiredline:
plot ’datafile’ using 1:(f($2)/$4) with lines title columnhead(2)
Anotherexample:
plot for [i=2:6] ’datafile’ using i title "Results for ".columnhead(i)
Seesetstyle labels(p.55),usingxticlabels (p.87),plottitle (p.91),using(p.85).
Enhancedtextmode
Manyterminaltypessupportanenhancedtextmodeinwhichadditionalformattinginformationisembedded
inthetextstring.Forexample,"x^2"willwritex-squaredasweareusedtoseeingit,withasuperscript2.
Thismodeisnormallyselectedwhenyousettheterminal,e.g. "settermpngenhanced",butmayalsobe
toggledafterwardusing"settermoptionenhanced",orbymarkingindividualstringsasin"set label’x
2’
noenhanced".
EnhancedTextControlCodes
Control
Example
Result
Explanation
^
a^x
ax
superscript
_
a_x
a
x
subscript
@
a@^b_{cd}
ab
cd
phantombox(occupiesnowidth)
&
d&{space}b d     b
insertsspaceofspeciedlength
~
~a{.8-}
~a
overprints’-’on’a’,raisedby.8
timesthecurrentfontsize
Bracescanbeusedtoplacemultiple-charactertextwhereasinglecharacterisexpected(e.g.,2^f10g). To
changethefontand/orsize,usethefullform:f/[fontname][=fontsizej*fontscale]textg.Thusf/Symbol=20
Ggisa20ptGAMMAandf/*0.75KgisaK atthree-quartersofwhateverfontsizeiscurrentlyineect.
(The’/’characterMUSTbetherstcharacterafterthe’f’.)
The phantom m box x is s useful for a@^b
c to align n superscripts andsubscripts but does not t work k well l for
overwritinganaccentonaletter. For r thelatter,itismuchbetter touseanencoding(e.g. . iso
8859
1or
VB.NET Image: How to Save Image & Print Image Using VB.NET
and printing multi-page document files, like PDF and Word different image encoders, including tif encoder, jpg encoder, png VB.NET Code to Save Image / Photo.
convert pdf pages to jpg online; convert pdf photo to jpg
VB.NET Image: Tutorial for Flipping Image Using Our .NET Image SDK
SDK, an image (including BMP, PNG, JPG, etc) can be becomes a mirror reflection of the photo on the powerful & profession imaging controls, PDF document, tiff
bulk pdf to jpg converter; best way to convert pdf to jpg
24
gnuplot4.6
utf8) that contains alargevariety of letters withaccents or other diacritical marks. . See e set t encoding
(p. 112). . Sincetheboxis s non-spacing,itissensibletoputtheshorter ofthesubscriptorsuperscriptin
thebox(thatis,afterthe@).
Spaceequalinlengthtoastringcanbeinsertedusingthe’&’character. Thus
’abc&{def}ghi’
wouldproduce
’abc
ghi’.
The’~’charactercausesthenextcharacterorbracketedtexttobeoverprintedbythefollowingcharacter
orbracketedtext. Thesecondtextwillbehorizontallycenteredontherst. Thus’~a/’willresultinan
’a’withaslashthroughit.Youcanalsoshiftthesecondtextverticallybyprecedingthesecondtextwitha
number,whichwilldenethefractionofthecurrentfontsizebywhichthetextwillberaisedorlowered.In
thiscasethenumberandtextmustbeenclosedinbracketsbecausemorethanonecharacterisnecessary. If
theoverprintedtextbeginswithanumber,putaspacebetweentheverticalosetandthetext(’~fabcgf.5
000g’);otherwisenospaceisneeded(’~fabcgf.5|g’). Youcanchangethefontforoneorbothstrings(’~
af.5/*.2og’|an’a’withaone-fth-size’o’ontop|andthespacebetweenthenumberandtheslashis
necessary),butyoucan’tchangeitafterthebeginningofthestring.Neithercanyouuseanyotherspecial
syntaxwithineitherstring. Youcan,ofcourse,usecontrolcharacters s byescapingthem(seebelow),such
as’~afn^g’
Youcanaccess specialsymbols numericallybyspecifyingncharacter-code(inoctal),e.g.,f/Symboln245g
isthesymbolfor innity. . Thisdoesnot t workformultibyteencodingslikeUTF-8,however. . InaUTF-8
environment,youshouldbeabletoentermultibytesequencesimplicitlybytypingorotherwiseselectingthe
characteryouwant.
Youcanescapecontrolcharactersusingn,e.g.,nn,nf,andsoon.
Butbeawarethatstringsindouble-quotesareparseddierentlythanthoseenclosedinsingle-quotes. The
majordierenceisthatbackslashesmayneedtobedoubledwhenindouble-quotedstrings.
Examples(thesearehardtodescribeinwords|trythem!):
set xlabel ’Time (10^6 {/Symbol m}s)’
set title ’{/Symbol=18 \\362@_{/=9.6 0}^{/=12 x}} \\
{/Helvetica e^{-{/Symbol m}^2/2} d}{/Symbol m}’
The le "ps
guide.ps"in the e /docs/psdoc subdirectory of the gnuplot source distributioncontains more
examplesoftheenhancedsyntax.
Environment
Anumberofshellenvironmentvariablesareunderstoodbygnuplot. Noneofthesearerequired,butmay
beuseful.
IfGNUTERMisdened,itisusedasthenameoftheterminaltypetobeused.Thisoverridesanyterminal
typesensedbygnuplotonstart-up,butisitselfoverriddenbythe.gnuplot(orequivalent)start-uple(see
startup(p.38))and,ofcourse,bylaterexplicitchanges.
GNUHELPmaybedenedtobethepathnameoftheHELPle(gnuplot.gih).
OnVMS,thelogicalnameGNUPLOT$HELPshouldbedenedasthenameofthehelplibraryforgnuplot.
Thegnuplothelpcanbeputinsideanysystemhelplibrary,allowingaccesstohelpfrombothwithinand
outsidegnuplotifdesired.
OnUnix,HOMEisusedasthenameofadirectorytosearchfora.gnuplotleifnoneisfoundinthecurrent
directory. OnMS-DOS,Windows s andOS/2, , GNUPLOTis s used. . OnWindows,theNT-specicvariable
USERPROFILEisalsotried. VMS,SYS$LOGIN:isused. Typehelpstartup.
OnUnix,PAGERisusedasanoutputlterforhelpmessages.
OnUnix,SHELLisusedfortheshellcommand.OnMS-DOSandOS/2,COMSPECisusedfortheshell
command.
C# PDF remove image library: remove, delete images from PDF in C#.
NET delete PDF pages, VB.NET convert PDF to SVG. vector image, graphic picture, digital photo, scanned signature remove multiple or all images from PDF document.
pdf to jpg converter; c# convert pdf to jpg
VB.NET PDF remove image library: remove, delete images from PDF in
NET convert PDF to text, C#.NET convert PDF to images vector image, graphic picture, digital photo, scanned signature or all image objects from PDF document in
convert pdf to jpg for; .net convert pdf to jpg
gnuplot4.6
25
FIT
SCRIPTmaybeusedtospecifyagnuplotcommandtobeexecutedwhenatisinterrupted|see
t (p.63). FIT
LOGspeciesthedefaultlenameoftheloglemaintainedbyt.
GNUPLOT
LIBmaybeusedtodeneadditionalsearchdirectoriesfordataandcommandles.Thevariable
maycontainasingledirectoryname,oralistofdirectoriesseparatedbyaplatform-specicpathseparator,
eg.’:’ onUnix,or’;’onDOS/Windows/OS/2platforms. ThecontentsofGNUPLOT
LIBareappendedto
theloadpathvariable,butnotsavedwiththesaveandsavesetcommands.
SeveralgnuplotterminaldriversaccessTrueTypefontsviathegdlibrary. Forthesedriversthefontsearch
path is controlledby y the environmental variable GDFONTPATH. Furthermore, , adefault font for r these
driversmaybesetviatheenvironmentalvariableGNUPLOT
DEFAULT
GDFONT.
The postscript terminal uses its own n font t search path. . It t is s controlled by y the environmental l vari-
able GNUPLOT
FONTPATH. The format is s the e same e as for GNUPLOT
LIB. The contents of GNU-
PLOT
FONTPATHare appendedto the fontpathvariable, but not savedwiththe save andsave e set
commands.
GNUPLOT
PS
DIRisusedbythepostscriptdrivertosearchforexternalprologueles.Dependingonthe
buildprocess,gnuplot contains eitherabuilt-incopyofthoseles oradefaulthardcodedpath. . Youcan
usethis variable havethepostscript terminalusecustom prologue les rather thanthedefaultles. . See
postscriptprologue(p. 215).
Expressions
Ingeneral,anymathematicalexpressionacceptedbyC,FORTRAN,Pascal,orBASICisvalid.Theprece-
denceoftheseoperatorsis determinedbythespecicationsoftheCprogramminglanguage. . Whitespace
(spacesandtabs)isignoredinsideexpressions.
Complex constants s are e expressed as s f<real>,<imag>g, , where e <real> > and<imag> must t be numerical
constants. Forexample,f3,2grepresents3+2i;f0,1grepresents s ’i’itself. . Thecurlybracesareexplicitly
requiredhere.
Notethatgnuplotusesboth"real"and"integer"arithmetic,likeFORTRANandC.Integersareenteredas
"1","-10",etc;realsas"1.0","-10.0","1e1",3.5e-1,etc. Themostimportantdierencebetweenthetwo
formsis indivision: : divisionof f integers truncates: : 5/2= = 2; ; divisionof reals s doesnot: : 5.0/2.0=2.5. In
mixedexpressions,integersare"promoted"torealsbeforeevaluation: 5/2e0= = 2.5. . Theresultofdivision
ofanegativeintegerbyapositiveonemayvaryamongcompilers. Tryatestlike"print-5/2"todetermine
ifyoursystemchooses-2or-3astheanswer.
Theintegerexpression"1/0"maybeusedtogeneratean"undened" ag,whichcausesapointtoignored.
Oryoucanusethepre-denedvariableNaNtoachievethesameresult.Seeusing(p.85)foranexample.
Therealandimaginarypartsofcomplexexpressionsarealwaysreal,whatevertheforminwhichtheyare
entered: inf3,2gthe"3"and"2"arereals,notintegers.
Gnuplot canalsoperformsimpleoperations onstrings andstringvariables. . For r example,the expression
("A"."B"eq"AB")evaluatesastrue,illustratingthestringconcatenationoperatorandthestringequality
operator.
Astringwhichcontainsanumericalvalueispromotedtothecorrespondingintegerorrealvalueifusedin
anumericalexpression. Thus("3"+"4"==7)and(6.78=="6.78")bothevaluatetotrue. . Aninteger,
butnotarealorcomplexvalue,ispromotedtoastringif usedinstringconcatenation. . Atypicalcaseis
theuseofintegerstoconstructlenamesorotherstrings;e.g. ("le".4eq"le4")istrue.
Substringscanbespeciedusingapostxedrangedescriptor[beg:end]. Forexample,"ABCDEF"[3:4]==
"CD"and "ABCDEF"[4:*]== = "DEF"The syntax "string"[beg:end] ] is s exactly equivalenttocallingthe
built-instring-valuedfunctionsubstr("string",beg,end),exceptthatyoucannotomiteitherbegorendfrom
thefunctioncall.
VB.NET PDF copy, paste image library: copy, paste, cut PDF images
pasting and cutting from adobe PDF file in image formats, including Jpeg or Jpg, Png, Gif and cut vector image, graphic picture, digital photo, scanned signature
convert multipage pdf to jpg; best program to convert pdf to jpg
VB.NET Image: Create Image from Stream; Stream to Image Converter
to capture image from web url, convert image to like image sharpening and old photo effect adding powerful & profession imaging controls, PDF document, tiff
change pdf to jpg file; convert pdf file into jpg format
26
gnuplot4.6
Functions
ThemathfunctionsingnuplotarethesameasthecorrespondingfunctionsintheUnixmathlibrary,except
thatallfunctionsacceptinteger,real,andcomplexargumentsunlessotherwisenoted.Functionsthataccept
orreturnangles(e.g.sin(x),cos(x),arg(z))treatanglevaluesasradians,butthismaybechangedtodegrees
usingthecommandsetangles.
Mathlibraryfunctions
Function
Arguments
Returns
abs(x)
any
absolutevalueofx,jxj;sametype
abs(x)
complex
lengthofx,
p
real(x)2+imag(x)2
acos(x)
any
cos
1
x(inversecosine)
acosh(x)
any
cosh
1
x(inversehyperboliccosine)inradians
airy(x)
any
AiryfunctionAi(x)
arg(x)
complex
thephaseofx
asin(x)
any
sin
1
x(inversesin)
asinh(x)
any
sinh
1
x(inversehyperbolicsin)inradians
atan(x)
any
tan
1
x(inversetangent)
atan2(y,x)
intorreal
tan
1
(y=x)(inversetangent)
atanh(x)
any
tanh
1
x(inversehyperbolictangent)inradians
EllipticK(k)
realk2(-1:1)
K(k)completeellipticintegraloftherstkind
EllipticE(k)
realk2[-1:1]
E(k)completeellipticintegralofthesecondkind
EllipticPi(n,k) realn<1,realk2(-1:1) ) (n;k)completeellipticintegralofthethirdkind
besj0(x)
intorreal
j
0
Besselfunctionofx,inradians
besj1(x)
intorreal
j
1
Besselfunctionofx,inradians
besy0(x)
intorreal
y
0
Besselfunctionofx,inradians
besy1(x)
intorreal
y
1
Besselfunctionofx,inradians
ceil(x)
any
dxe,smallestintegernotlessthanx(realpart)
cos(x)
any
cosx,cosineofx
cosh(x)
any
coshx,hyperboliccosineofxinradians
erf(x)
any
erf(real(x)),errorfunctionofreal(x)
erfc(x)
any
erfc(real(x)),1.0-errorfunctionofreal(x)
exp(x)
any
e
x
,exponentialfunctionofx
expint(n,x)
intn0,realx0
E
n
(x)=
R
1
1
t
n
e
xt
dt,exponentialintegralofx
oor(x)
any
bxc,largestintegernotgreaterthanx(realpart)
gamma(x)
any
gamma(real(x)),gammafunctionofreal(x)
ibeta(p,q,x)
any
ibeta(real(p;q;x)),ibetafunctionofreal(p,q,x)
inverf(x)
any
inverseerrorfunctionofreal(x)
igamma(a,x)
any
igamma(real(a;x)),igammafunctionofreal(a,x)
imag(x)
complex
imaginarypartofxasarealnumber
invnorm(x)
any
inversenormaldistributionfunctionofreal(x)
int(x)
real
integerpartofx,truncatedtowardzero
lambertw(x)
real
LambertWfunction
lgamma(x)
any
lgamma(real(x)),lgammafunctionofreal(x)
log(x)
any
log
e
x,naturallogarithm(basee)ofx
log10(x)
any
log
10
x,logarithm(base10)ofx
norm(x)
any
normaldistribution(Gaussian)functionofreal(x)
rand(x)
int
pseudorandomnumberintheinterval[0:1]
real(x)
any
realpartofx
sgn(x)
any
1ifx>0,-1ifx<0,0ifx=0. imag(x)ignored
sin(x)
any
sinx,sineofx
sinh(x)
any
sinhx,hyperbolicsineofxinradians
sqrt(x)
any
p
x,squarerootofx
tan(x)
any
tanx,tangentofx
tanh(x)
any
tanhx,hyperbolictangentofxinradians
voigt(x,y)
real
Voigt/Faddeevafunction
y
R
exp(t
2
)
(x t)2+y2
dt
VB.NET PowerPoint: Use .NET Converter to Convert PPT to Raster
so it is not widely used for digital photo. If temp IsNot Nothing Then temp.Convert( imageStream, ImageFormat & profession imaging controls, PDF document, image
convert pdf file to jpg on; conversion of pdf to jpg
VB.NET Image: VB.NET Planet Barcode Generator for Image, Picture &
gif, jpeg, bmp and tiff) and a document file (supported files are PDF, Word & TIFF to decide the output barcode image format as you need, including JPG, GIF, BMP
reader convert pdf to jpg; .pdf to jpg
gnuplot4.6
27
Stringfunctions
Function
Arguments Returns
gprintf("format",x,...)
any
stringresultfromapplyinggnuplot’sformatparser
sprintf("format",x,...)
multiple
stringresultfromC-languagesprintf
strlen("string")
string
intlengthofstringinbytes
strstrt("string","key")
strings
intindexofrstcharacterofsubstring"key"
substr("string",beg,end)
multiple
string"string"[beg:end]
strftime("timeformat",t)
any
stringresultfromapplyinggnuplot’stimeparser
strptime("timeformat",s)
string
secondssinceyear2000asgiveninstrings
system("command")
string
stringcontainingoutputstreamofshellcommand
word("string",n)
string,int
returnsthenthwordin"string"
words("string")
string
returnsthenumberofwordsin"string"
othergnuplotfunctions
Function
Arguments
Returns
column(x)
intorstring
columnxduringdatalemanipulation.
columnhead(x)
int
stringcontainingrstentryofcolumnxindatale.
dened(X)
variablename [DEPRECATED]returns1ifXisdened,0otherwise.
exists("X")
string
returns1ifavariablenamedXisdened,0otherwise.
stringcolumn(x)
intorstring
contentofcolumnxasastring.
timecolumn(x)
int
timecolumnxduringdatalemanipulation.
tm
hour(x)
int
thehour
tm
mday(x)
int
thedayofthemonth
tm
min(x)
int
theminute
tm
mon(x)
int
themonth
tm
sec(x)
int
thesecond
tm
wday(x)
int
thedayoftheweek
tm
yday(x)
int
thedayoftheyear
tm
year(x)
int
theyear
time(x)
any
thecurrentsystemtime
valid(x)
int
testvalidityofcolumn(x)duringdatalemanip.
value("name")
string
returnsthevalueofthenamedvariable.
Ellipticintegrals
TheEllipticK(k)functionreturnsthecompleteellipticintegraloftherstkind,i.e. thedeniteintegral
between0andpi/2ofthefunction(1-(k*sin(p))**2)**(-0.5). Thedomainofkis-1to1(exclusive).
TheEllipticE(k)functionreturnsthecompleteellipticintegralofthesecondkind,i.e.thedeniteintegral
between0andpi/2ofthefunction(1-(k*sin(p))**2)**0.5. Thedomainofkis-1to1(inclusive).
TheEllipticPi(n,k)functionreturnsthecompleteellipticintegralofthethirdkind,i.e.thedeniteintegral
between0andpi/2ofthefunction(1-(k*sin(p))**2)**(-0.5)/(1-n*sin(p)**2).Theparameternmust
belessthan1,whilek mustliebetween-1and1(exclusive). . NotethatbydenitionEllipticPi(0,k) ) ==
EllipticK(k)forallpossiblevaluesofk.
Randomnumbergenerator
Thefunctionrand()producesasequenceofpseudo-randomnumbersbetween0and1usinganalgorithm
from P.L’Ecuyer andS.Cote,"Implementing arandom numberpackage withsplittingfacilities", ACM
TransactionsonMathematicalSoftware,17:98-111(1991).
rand(0)
returns a pseudo random number in the interval [0:1]
generated from the current value of two internal
32-bit seeds.
rand(-1)
resets both seeds to a standard value.
28
gnuplot4.6
rand(x)
for integer r 0 < x < 2^31-1 sets both internal seeds
to x.
rand({x,y}) for r integer r 0 < x,y < 2^31-1 sets seed1 to x and
seed2 to y.
Value
B= value("A")iseectivelythesameas B=A,whereAisthenameofauser-denedvariable. . This s is
usefulwhenthenameofthevariableisitselfheldinastringvariable.Seeuser-denedvariables(p.30).
Italsoallowsyoutoreadthenameofavariablefromadatale.Iftheargumentisanumericalexpression,
value() returns s the e value of that expression. . If f the argument t is astring that t does not t correspondto a
currentlydenedvariable,value()returnsNaN.
Operators
Theoperatorsingnuplot arethesame as thecorrespondingoperatorsinthe Cprogramminglanguage,
except that all operators s accept t integer, , real, andcomplex x arguments, , unless s otherwise noted. . The e **
operator(exponentiation)issupported,asinFORTRAN.
Parenthesesmaybeusedtochangeorderofevaluation.
Unary
Thefollowingisalistofalltheunaryoperatorsandtheirusages:
UnaryOperators
Symbol Example e Explanation
-
-a
unaryminus
+
+a
unaryplus(no-operation)
~
~a
*one’scomplement
!
!a
*logicalnegation
!
a!
*factorial
$
$3
*callarg/columnduring‘using‘manipulation
(*)Starredexplanationsindicatethattheoperatorrequiresanintegerargument.
Operatorprecedenceis thesameasinFortranandC.Asinthoselanguages,parentheses maybeusedto
changetheorderofoperation.Thus-2**2=-4,but(-2)**2=4.
Thefactorialoperatorreturnsarealnumbertoallowagreaterrange.
Binary
Thefollowingisalistofallthebinaryoperatorsandtheirusages:
gnuplot4.6
29
BinaryOperators
Symbol Example Explanation
**
a**b
exponentiation
*
a*b
multiplication
/
a/b
division
%
a%b
*modulo
+
a+b
addition
-
a-b
subtraction
==
a==b
equality
!=
a!=b
inequality
<
a<b
lessthan
<=
a<=b
lessthanorequalto
>
a>b
greaterthan
>=
a>=b
greaterthanorequalto
&
a&b
*bitwiseAND
^
a^b
*bitwiseexclusiveOR
|
a|b
*bitwiseinclusiveOR
&&
a&&b
*logicalAND
||
a||b
*logicalOR
=
a = = b
assignment
,
(a,b)
serialevaluation
.
A.B
stringconcatenation
eq
A eq B
stringequality
ne
A ne B
stringinequality
(*) Starredexplanations indicatethat theoperator requires integer arguments. . Capitalletters s A andB
indicatethattheoperatorrequiresstringarguments.
LogicalAND(&&)andOR(jj)short-circuitthewaytheydoinC.Thatis,thesecond&&operandisnot
evaluatediftherstisfalse;thesecondjjoperandisnotevaluatediftherstistrue.
Serialevaluationoccursonlyinparenthesesandisguaranteedtoproceedinlefttorightorder. Thevalueof
therightmostsubexpressionisreturned.
Ternary
Thereisasingleternaryoperator:
TernaryOperator
Symbol Example e Explanation
?:
a?b:c
ternaryoperation
TheternaryoperatorbehavesasitdoesinC.Therstargument(a),whichmustbeaninteger,isevaluated.
Ifitistrue(non-zero),thesecondargument(b)isevaluatedandreturned;otherwisethethirdargument(c)
isevaluatedandreturned.
Theternaryoperatorisveryusefulbothinconstructingpiecewisefunctionsandinplottingpointsonlywhen
certainconditionsaremet.
Examples:
Plotafunctionthatistoequalsin(x)for0<=x<1,1/xfor1<=x<2,andundenedelsewhere:
f(x) = 0<=x && & x<1 1 ? sin(x) : 1<=x && x<2 ? 1/x : 1/0
plot f(x)
Notethatgnuplotquietlyignoresundenedvalues,sothenalbranchofthefunction(1/0)willproduce
noplottablepoints. Notealsothatf(x)willbeplottedasacontinuousfunctionacrossthediscontinuityif
alinestyleis used. . Toplotit t discontinuously,createseparate functions forthetwopieces. . (Parametric
functionsarealsousefulforthispurpose.)
30
gnuplot4.6
Fordatainale,plottheaverageofthedataincolumns2and3againstthedatumincolumn1,butonly
ifthedatumincolumn4isnon-negative:
plot ’file’ using 1:( $4<0 ? 1/0 : ($2+$3)/2 )
Foranexplanationoftheusingsyntax,pleaseseeplotdataleusing(p. 85).
Summation
Asummationexpressionhastheform
sum [<var> = <start> : <end>] <expression>
<var>istreatedasanintegervariablethattakesonsuccessiveintegralvaluesfrom<start>to<end>. For
eachofthese,thecurrentvalueof<expression>isaddedtoarunningtotalwhosenalvaluebecomesthe
valueofthesummationexpression. Examples:
print sum [i=1:10] i
55.
# Equivalent to o plot t ’data’ using 1:($2+$3+$4+$5+$6+...)
plot ’data’ using 1 : (sum [col=2:MAXCOL] column(col))
Itisnotnecessarythat<expression> containthevariable<var>. . Although<start>and<end>canbe
speciedasvariablesorexpressions,theirvaluecannotbechangeddynamicallyasaside-eectofcarrying
outthesummation.If<end>islessthan<start>thenthevalueofthesummationiszero.
Gnuplot-denedvariables
Gnuplotmaintainsanumberofread-onlyvariablesthatre ectthecurrentinternalstateoftheprogramand
themostrecentplot. Thesevariablesbeginwiththeprex"GPVAL
".ExamplesincludeGPVAL
TERM,
GPVAL
X
MIN,GPVAL
X
MAX,GPVAL
Y
MIN.Typeshow variablesalltodisplaythecompletelist
andcurrentvalues.Valuesrelatedtoaxesparameters(ranges,logbase)arevaluesusedduringthelastplot,
notthosecurrentlyset.
Example:Tocalculatethefractionalscreencoordinatesofthepoint[X,Y]
GRAPH_X = (X - GPVAL_X_MIN) / (GPVAL_X_MAX - GPVAL_X_MIN)
GRAPH_Y = (Y - GPVAL_Y_MIN) / (GPVAL_Y_MAX - GPVAL_Y_MIN)
SCREEN_X = GPVAL_TERM_XMIN + GRAPH_X * (GPVAL_TERM_XMAX - GPVAL_TERM_XMIN)
SCREEN_Y = GPVAL_TERM_YMIN + GRAPH_Y * (GPVAL_TERM_YMAX - GPVAL_TERM_YMIN)
FRAC_X = SCREEN_X / GPVAL_TERM_XSIZE
FRAC_Y = SCREEN_Y / GPVAL_TERM_YSIZE
Theread-onlyvariableGPVAL
ERRNOissettoanon-zerovalueifanygnuplotcommandterminatesearly
duetoanerror. The e mostrecent errormessageis storedinthe string variableGPVAL
ERRMSG.Both
GPVAL
ERRNOandGPVAL
ERRMSGcanbeclearedusingthecommandreseterrors.
Interactive terminals withmousefunctionalitymaintainread-only variables withthe prex "MOUSE
".
Seemouse variables(p. 37)fordetails.
Thetmechanism uses severalvariableswithnamesthatbegin"FIT
". Itis s safesttoavoidusingsuch
names. "FIT
LIMIT", however, , is s one e that youmay y wish to o redene. . Under r set t errorvariables,
theerror foreachttedparameter willbestoredinavariablenamedliketheparameter,butwith"
err"
appended.Seethedocumentationont (p.63)fordetails.
Seeuser-denedvariables(p. 30),reseterrors(p. 96),mousevariables (p.37),andt(p. 63).
User-denedvariablesandfunctions
Newuser-denedvariablesandfunctionsofonethroughtwelvevariablesmaybedeclaredandusedanywhere,
includingontheplotcommanditself.
User-denedfunctionsyntax:
Documents you may be interested
Documents you may be interested