Chapter15: Plotting
345
GreekLowercaseLetters
Code
Sym
Code
Sym
Code
Sym
nalpha
nbeta
ngamma
ndelta
nepsilon
nzeta
neta
ntheta
nvartheta
#
niota
nkappa
nlambda
nmu
nnu
nxi
no
o
npi
nvarpi
$
nrho
nsigma
nvarsigma
&
ntau
nupsilon
nphi
nchi
npsi
nomega
!
GreekUppercaseLetters
Code
Sym
Code
Sym
Code
Sym
nGamma
Γ
nDelta
Δ
nTheta
Θ
nLambda
Λ
nXi
Ξ
nPi
Π
nSigma
Σ
nUpsilon
ϒ
nPhi
Φ
nPsi
Ψ
nOmega
Ω
MiscSymbolsTypeOrd
Code
Sym
Code
Sym
Code
Sym
naleph
@
nwp
}
nRe
<
nIm
=
npartial
@
ninfty
1
nprime
0
nnabla
r
nsurd
p
nangle
6
nforall
8
nexists
9
nneg
:
nclubsuit
|
ndiamondsuit
}
nheartsuit
~
nspadesuit
“Large”Operators
Code
Sym
Code
Sym
Code
Sym
nint
R
Binaryoperators
Code
Sym
Code
Sym
Code
Sym
npm
ncdot
ntimes
nast
ncirc
nbullet
ndiv
ncap
\
ncup
[
nvee
_
nwedge
^
noplus
notimes
noslash
Table15.1:AvailablespecialcharactersinT
E
Xmode
Cannot print pdf file no pages selected - Split, seperate PDF into multiple files in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Explain How to Split PDF Document in Visual C#.NET Application
break password pdf; pdf no pages selected
Cannot print pdf file no pages selected - VB.NET PDF File Split Library: Split, seperate PDF into multiple files in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
VB.NET PDF Document Splitter Control to Disassemble PDF Document
can't cut and paste from pdf; break pdf
346
GNUOctave
Relations
Code
Sym
Code
Sym
Code
Sym
nleq
nsubset
nsubseteq
nin
2
ngeq
nsupset
nsupseteq
nni
3
nmid
j
nequiv
nsim
napprox
ncong
=
npropto
/
nperp
?
Arrows
Code
Sym
Code
Sym
Code
Sym
nleftarrow
nLeftarrow
(
nrightarrow
!
nRightarrow
)
nleftrightarrow
$
nuparrow
"
ndownarrow
#
OpeningsandClosings
Code
Sym
Code
Sym
Code
Sym
nlfloor
b
nlangle
h
nlceil
d
nrfloor
c
nrangle
i
nrceil
e
AlternateNames
Code
Sym
Code
Sym
Code
Sym
nneq
6=
Other(notinAppendixFTables)
Code
Sym
Code
Sym
Code
Sym
nldots
:::
n0
ncopyright
c
ndeg
Table15.1:AvailablespecialcharactersinT
E
Xmode(cont.)
Acompleteexampleshowingthecapabilitiesoftheextendedtextis
x = = 0:0.01:3;
plot (x, , erf f (x));
hold on;
plot (x,x,"r");
axis ([0, 3, 0, 1]);
text (0.65, , 0.6175, strcat t (’\leftarrow w x = {2/\surd\pi’,
’ {\fontsize{16}\int_{\fontsize{8}0}^{\fontsize{8}x}}’,
’ e^{-t^2} } dt} = 0.6175’))
TheresultofwhichcanbeseeninFigure15.7
C# Image: Create C#.NET Windows Document Image Viewer | Online
and viewing multiple document & image formats (PDF, MS Word, Tiff control, there will prompt a window "cannot open your Customize the Way to Open and Store File.
break up pdf file; acrobat split pdf pages
Chapter15: Plotting
347
0
0.2
0.4
0.6
0.8
1
0
0.5
1
1.5
2
2.5
3
erf (x)
x
erf (x) with text annotation
← x = 2/√π 
0
x
e
-t
2
dt = 0.6175
Figure15.7:ExampleofinclusionoftextwiththeT
E
Xinterpreter
15.2.9 PrintingandSavingPlots
Theprintcommandallowsyoutosendplotstoyouprinterandtosaveplotsinavariety
offormats.Forexample,
print -dpsc
printsthecurrentfiguretoacolorPostScriptprinter. And,
print -deps foo.eps
savesthecurrentfiguretoanencapsulatedPostScriptfilecalledfoo.eps.
Thedifferentgraphictoolkitshavedifferentprintcapabilities.Inparticular,theOpenGL
basedtoolkits suchas fltk donot support the "interpreter" propertyof text objects.
Thismeansspecialsymbolsdrawnwiththe"tex"interpreterwillappearcorrectlyon-screen
but willberenderedwithinterpreter "none"whenprinting. . Switchgraphics s toolkitsfor
printingifthisisaconcern.
[FunctionFile]
print
()
[FunctionFile]
print
(
options
)
[FunctionFile]
print
(
filename
,
options
)
[FunctionFile]
print
(
h
,
filename
,
options
)
Printaplot,orsaveittoafile.
Bothoutputformattedforprinting(PDFandPostScript),andmanybitmappedand
vectorimageformatsaresupported.
filename defines s the name of theoutput file. . Ifthe e filenamehas nosuffix,one is
inferredfromthespecifieddeviceandappendedtothefile name. . Ifnofilenameis
specified,theoutputissenttotheprinter.
hspecifiesthehandleofthefiguretoprint. Ifnohandleisspecifiedthecurrentfigure
isused.
348
GNUOctave
For output to aprinter, , PostScript t file,orPDF file,thepapersizeis specifiedby
the figure’s papersize property. . The e location and size of the image on the page
arespecifiedbythefigure’spaperpositionproperty. Theorientationofthepageis
specifiedbythefigure’spaperorientationproperty.
The width and height t of f images s are e specified by y the figure’s paperpositon(3:4)
propertyvalues.
Theprintcommandsupportsmanyoptions:
-fh
Specify the handle, , h, , of the figure to be printed. . The e default is s the
currentfigure.
-Pprinter
Settheprinternametowhichtheplotissentifnofilename isspecified.
-Gghostscript_command
SpecifythecommandforcallingGhostscript.ForUnixandWindowsthe
defaultsare"gs"and"gswin32c",respectively.
-color
-mono
Colorormonochromeoutput.
-solid
-dashed
Forcealllinestobesolidordashed,respectively.
-portrait
-landscape
Specify the orientationof the plot for printedoutput. . For r non-printed
outputtheaspectratiooftheoutputcorrespondstotheplotareadefined
bythe"paperposition"propertyintheorientationspecified. Thisop-
tionisequivalenttochangingthefigure’s"paperorientation"property.
-TextAlphaBits=n
-GraphicsAlphaBits=n
Octaveisabletoproduceoutputforvariousprinters,bitmaps,andvector
formatsbyusingGhostscript.Forbitmapandprinteroutputanti-aliasing
isappliedusingGhostscript’sTextAlphaBitsandGraphicsAlphaBitsop-
tions.Thedefaultnumberofbitsforeachis4. AllowedvaluesforN are
1,2,or4.
-ddevice Theavailableoutputformatisspecifiedbytheoptiondevice,andisone
of:
ps
ps2
psc
psc2
PostScript(level1and2,monoandcolor).TheFLTKgraph-
icstoolkitgeneratesPostScriptlevel3.0.
eps
eps2
epsc
epsc2
EncapsulatedPostScript(level1and2,monoandcolor).The
FLTKgraphictoolkitgeneratesPostScriptlevel3.0.
Chapter15: Plotting
349
pslatex
epslatex
pdflatex
pslatexstandalone
epslatexstandalone
pdflatexstandalone
GenerateaLAT
E
Xfilefilename.texforthetextportionsof
aplotandafilefilename.(ps|eps|pdf)fortheremaining
graphics. Thegraphicsfilesuffix.ps|eps|pdfisdetermined
bythespecifieddevicetype.TheLAT
E
Xfileproducedbythe
‘standalone’optioncanbeprocesseddirectlybyLAT
E
X.The
filegeneratedwithoutthe‘standalone’optionisintendedto
beincludedfromanotherL
A
T
E
Xdocument.Ineithercase,the
LAT
E
Xfilecontainsan\includegraphicscommandsothat
the generated graphics s file e is s automatically y included d when
theLAT
E
Xfileis processed. . The e text thatis writtentothe
L
A
T
E
X file contains the strings exactly y as they were e speci-
fiedintheplot. Ifany y specialcharacters of theT
E
Xmode
interpreter wereused,the filemust be edited d beforeL
A
T
E
X
processing. Specifically,the e specialcharacters must been-
closedwithdollarsigns($...$),andothercharactersthat
arerecognizedbyLAT
E
Xmayalsoneedediting(.e.g.,braces).
The‘pdflatex’device,andanyofthe‘standalone’formats,
arenotavailablewiththeGnuplottoolkit.
tikz
GenerateaL
A
T
E
XfileusingPGF/TikZ.FortheFLTKtoolkit
theresultisPGF.
ill
aifm
AdobeIllustrator(ObsoleteforGnuplotversions>4.2)
cdr
corel
CorelDraw
dxf
AutoCAD
emf
meta
MicrosoftEnhancedMetafile
fig
XFig. For r the Gnuplot graphicstoolkit, , the additionalop-
tions-textspecialor-textnormalcanbeusedtocontrol
whetherthespecialflagshouldbesetforthetextinthefig-
ure. (defaultis-textnormal)
hpgl
HPplotterlanguage
mf
Metafont
png
Portablenetworkgraphics
jpg
jpeg
JPEGimage
350
GNUOctave
gif
GIFimage(onlyavailablefortheGnuplotgraphicstoolkit)
pbm
PBMplus
svg
Scalablevectorgraphics
pdf
Portabledocumentformat
Ifthedeviceisomitted,itisinferredfromthefileextension,orifthere
isnofilenameitissenttotheprinterasPostScript.
-dghostscript_device
AdditionaldevicesaresupportedbyGhostscript.Someexamplesare;
pdfwrite Producespdfoutputfromeps
ljet2p
HPLaserJetIIP
pcx24b
24-bitcolorPCXfileformat
ppm
PortablePixelMapfileformat
For a a complete e list, type e system("gs-h") ) to o see what t formats s and
devicesareavailable.
WhenGhostscriptoutputissenttoaprinterthesizeisdeterminedbythe
figure’s"papersize"property.Whentheoutputissenttoafilethesize
is determinedbytheplotboxdefinedby thefigure’s"paperposition"
property.
-append
AppendPostScriptorPDFoutputtoapre-existingfileofthesametype.
-rNUM
Resolutionofbitmapsinpixelsperinch.ForbothmetafilesandSVGthe
defaultisthescreenresolution;forotherformatsitis150dpi.Tospecify
screenresolution,use"-r0".
-loose
-tight
Forceatightorlooseboundingboxforepsfiles.Thedefaultisloose.
-preview Addapreviewtoepsfiles. . Supportedformatsare:
-interchange
Provideaninterchangepreview.
-metafile
Provideametafilepreview.
-pict
Providepictpreview.
-tiff
Provideatiffpreview.
-Sxsize,ysize
Plot size e inpixels for EMF,GIF, JPEG, PBM,PNG, and SVG. . For
PS,EPS,PDF,andothervectorformatstheplotsizeisinpoints. This
optionisequivalenttochangingthesizeoftheplotboxassociatedwith
the"paperposition"property. Whenusingthecommandformof f the
printfunction youmust t quote the xsize,ysize option. . For r example, , by
writing"-S640,480".
Chapter15: Plotting
351
-Ffontname
-Ffontname:size
-F:size
Usefontnameand/orfontsize foralltext. fontnameisignoredforsome
devices: dxf,fig,hpgl,etc.
Thefilenameandoptionscanbegiveninanyorder.
Example:Printtoafileusingthepdfdevice.
figure (1);
clf ();
surf (peaks);
print figure1.pdf
Example:Printtoafileusingjpgdevice.
clf ();
surf (peaks);
print -djpg g figure2.jpg
Example:PrinttoprinternamedPS
printerusingpsformat.
clf ();
surf (peaks);
print -dpswrite e -PPS_printer
Seealso:[saveas],page351,[hgsave],page352,[orient],page351,[figure],page338.
[FunctionFile]
saveas
(
h
,
filename
)
[FunctionFile]
saveas
(
h
,
filename
,
fmt
)
Savegraphicobjecthtothefilefilenameingraphicformatfmt.
fmtshouldbeoneofthefollowingformats:
ps
PostScript
eps
EncapsulatedPostScript
jpg
JPEGImage
png
PNGImage
emf
EnhancedMetaFile
pdf
PortableDocumentFormat
Alldeviceformatsspecifiedinprintmayalsobeused.Iffmtisomitteditisextracted
fromtheextensionoffilename. Thedefaultformatis"pdf".
clf ();
surf (peaks);
saveas (1, "figure1.png");
Seealso: [print],page347,[hgsave],page352,[orient],page351.
[FunctionFile]
orient
(
orientation
)
[FunctionFile]
orient
(
hfig
,
orientation
)
[FunctionFile]
orientation = = orient
()
[FunctionFile]
orientation = = orient
(
hfig
)
Queryorsettheprintorientationforfigurehfig.
352
GNUOctave
Validvaluesfororientationare"portrait","landscape",and"tall".
The"landscape"optionchangestheorientationsotheplotwidthislargerthanthe
plotheight. The"paperposition" " isalsomodifiedsothat the plot fills the page,
whileleavinga0.25inchborder.
The "tall" optionsets the orientation to "portrait" andfillsthe page with the
plot,whileleavinga0.25inchborder.
The"portrait"option(default)changestheorientationsotheplotheightislarger
thantheplotwidth.Italsorestoresthedefault"paperposition"property.
Whencalledwithnoarguments,returnthecurrentprintorientation.
Iftheargumenthfig isomitted,thenoperateonthecurrentfigurereturnedbygcf.
Seealso: [print],page347,[saveas],page351.
printandsaveasareusedwhenworkonaplothasfinishedandtheoutputmustbeina
publication-readyformat.Duringintermediatestagesitisoftenbettertosavethegraphics
objectandallofitsassociatedinformationsothatchanges—tocolors,axislimits,marker
styles,etc.—canbemadeeasilyfromwithinOctave. Thehgsave/hgload d commandscan
beusedtosaveandre-createagraphicsobject.
[FunctionFile]
hgsave
(
filename
)
[FunctionFile]
hgsave
(
h
,
filename
)
[FunctionFile]
hgsave
(
h
,
filename
,
fmt
)
Savethegraphicshandlehtothefilefilenameintheformatfmt.
Ifunspecified,histhecurrentfigureasreturnedbygcf.
Whenfilenamedoesnothaveanextensionthedefaultfilenameextension.ofigwill
beappended.
Ifpresent,fmtshouldbeoneofthefollowing:
 -binary,-float-binary
 -hdf5,-float-hdf5
 -V7,-v7,-7,-mat7-binary
 -V6,-v6,-6,-mat6-binary
 -text
 -zip,-z
Whenproducinggraphicsforfinalpublicationuseprintorsaveas.Whenitisimpor-
tanttobeabletocontinuetoeditafigureasanOctaveobject,usehgsave/hgload.
See also: [hgload], page 352[hdl2struct], page e 364[saveas], page e 351[print],
page347.
[FunctionFile]
h = = hgload
(
filename
)
Loadthegraphicsobjectinfilenameintothegraphicshandleh.
Iffilename has s noextension,Octavewilltry tofindthe filewith h andwithoutthe
standardextensionof.ofig.
Seealso: [hgsave],page352,[struct2hdl],page364.
Chapter15: Plotting
353
15.2.10 InteractingwithPlots
Theusercanselectpointsonaplotwiththeginputfunctionorselectionthepositionat
whichtoplacetextontheplotwiththegtextfunctionusingthemouse. Menusmayalso
becreatedandpopulatedwithspecificusercommandsviatheuimenufunction.
[FunctionFile]
[x, y, , buttons] = ginput
(
n
)
[FunctionFile]
[x, y, , buttons] = ginput
()
Returnthepositionandtypeofmousebuttonclicksand/orkeystrokesinthecurrent
figurewindow.
Ifnisdefined,thencaptureneventsbeforereturning.Whennisnotdefinedginput
willloopuntilthereturnkeyRETispressed.
Thereturnvaluesx,y arethecoordinateswherethemousewasclickedintheunits
ofthecurrentaxes.Thereturnvaluebuttonis1,2,or3fortheleft,middle,orright
button. IfakeyispressedtheASCIIvalueisreturnedinbutton.
Implementation Note: : ginput t is intenteded for 2-D plots. . For r 3-D D plots see e the
currentpointpropertyofthecurrentaxeswhichcanbetransformedwithknowledge
ofthecurrentviewintodataunits.
Seealso: [gtext],page353,[waitforbuttonpress],page353.
[FunctionFile]
waitforbuttonpress
()
[FunctionFile]
b = = waitforbuttonpress
()
Waitformouseclickorkeypressoverthecurrentfigurewindow.
Thereturnvalueofbis0ifamousebuttonwaspressedor1ifakeywaspressed.
Seealso: [waitfor],page746,[ginput],page353,[kbhit],page239.
[FunctionFile]
gtext
(
s
)
[FunctionFile]
gtext
(
s1
,
s2
,...
)
[FunctionFile]
gtext
(
s1
;
s2
;...
)
[FunctionFile]
gtext
(...,
prop
,
val
,...)
[FunctionFile]
h = = gtext
(...)
Placetextonthecurrentfigureusingthemouse.
Thetextisdefinedbythestrings.Ifsisacellstringorganizedasarowvectorthen
eachstringofthecellarrayiswrittentoaseparateline.Ifsisorganizedasacolumn
vectorthenonestringelementofthecellarrayisplacedforeverymouseclick.
Optionalproperty/valuepairsarepasseddirectlytotheunderlyingtextobjects.
Theoptionalreturnvaluehisagraphicshandletothecreatedtextobject(s).
Seealso: [ginput],page353,[text],page332.
[FunctionFile]
hui = = uimenu
(
property
,
value
,...)
[FunctionFile]
hui = = uimenu
(
h
,
property
,
value
,...)
Createauimenuobjectandreturnahandletoit.
Ifhis omittedthenatop-levelmenuforthecurrentfigureis created. . Ifhisgiven
thenasubmenurelativetohiscreated.
uimenuobjectshavethefollowingspecificproperties:
354
GNUOctave
"accelerator"
AstringcontainingthekeycombinationtogetherwithCTRLtoexecute
thismenuentry(e.g.,"x"forCTRL+x).
"callback"
Isthefunctioncalledwhenthismenuentryisexecuted.Itcanbeeither
afunctionstring(e.g.,"myfun"),afunctionhandle(e.g.,@myfun)ora
cellarraycontainingthefunctionhandleandargumentsforthecallback
function(e.g.,
@myfun,arg1,arg2
).
"checked"
Canbeset"on"or"off".Setsamarkatthismenuentry.
"enable" Canbeset"on"or"off".Ifdisabledthemenuentrycannotbeselected
anditisgrayedout.
"foregroundcolor"
Acolorvaluesettingthetextcolorforthismenuentry.
"label"
Astringcontainingthelabelforthismenuentry. A"&"-symbolcanbe
usedtomarkthe"accelerator"character(e.g.,"E&xit")
"position"
Anscalar valuecontainingtherelativemenu u position. . Theentrywith
thelowestvalueisatthefirstpositionstartingfromleftortop.
"separator"
Canbeset"on"or"off". Ifenableditdrawsaseparatorlineabovethe
currentposition. Itisignoredfortoplevelentries.
Examples:
f = uimenu ("label", "&File", "accelerator", "f");
e = uimenu ("label", "&Edit", "accelerator", "e");
uimenu (f, "label", , "Close", , "accelerator", "q", ...
"callback", "close (gcf)");
uimenu (e, "label", , "Toggle &Grid", "accelerator", , "g", ...
"callback", "grid (gca)");
Seealso: [figure],page338.
15.2.11 TestPlottingFunctions
Thefunctionssombreroandpeaksprovideawaytocheckthatplottingisworking.Typing
eithersombreroorpeaksattheOctavepromptshoulddisplayathree-dimensionalplot.
[FunctionFile]
sombrero
()
[FunctionFile]
sombrero
(
n
)
[FunctionFile]
z = = sombrero
(...)
[FunctionFile]
[x, y, , z] = = sombrero
(...)
Plotthefamiliar3-Dsombrerofunction.
Thefunctionplottedis
z=
sin(
p
(x
2
+y
2
))
p
(x
2
+y
2
)
Documents you may be interested
Documents you may be interested