CHAPTER11. INSERTINGPLOTSINTOL
A
T
E
XREPORTS
103
·
L
A
T
E
XiswellsetuptoinsertPostscriptgraphics
11.2 ProducingPostscriptGraphicsinS-P
LUS
·
Canclickonagraphsheetpageandusethe
File
menutoexporttoafile
·
Toautomatetheprocesstoallowbatchusagethiscanbedonebycalling
the
postscript
function:
postscript(’filename.ps’, options)
plot(....)
title(....)
dev.off()
·
dev.off
closesthe graphics file and writes
’filename.ps’
to thecurrent
workingdirectory
a
·
Tousebetterdefaultsforthesizeofthegraphic,andforfontsandspacing
aroundtheaxes,usetheHmisc
setps
function
·
Unlikemostfunctionshavingafilenameasanargument,youdonotenclose
thefilenameinquotesfor
setps
·
setps
adds
.ps
totheendofthefilecreatedusing
postscript
·
Thefirstargumentto
setps
isthebasefilename,anditmustbea legalS
name
b
·
LaterinL
A
T
E
Xweusethisbasenameasasymbolicreferencetoaspecific
figuresothatyoucansay
a
Thisisthesameplacewherescriptfilesaresavedbydefault.
b
ThisalsoinsuresthatthenameisalegalL
A
T
E
XnamesothatitcanbeusedasasymboliclabelforreferencinginsidetheL
A
T
E
Xdocument.
How to convert pdf to powerpoint on - SDK control API:C# Create PDF from PowerPoint Library to convert pptx, ppt to PDF in C#.net, ASP.NET MVC, WinForms, WPF
Online C# Tutorial for Creating PDF from Microsoft PowerPoint Presentation
www.rasteredge.com
How to convert pdf to powerpoint on - SDK control API:VB.NET Create PDF from PowerPoint Library to convert pptx, ppt to PDF in vb.net, ASP.NET MVC, WinForms, WPF
VB.NET Tutorial for Export PDF file from Microsoft Office PowerPoint
www.rasteredge.com
CHAPTER11. INSERTINGPLOTSINTOL
A
T
E
XREPORTS
104
See Figure \ref{filename} } for r the e results.
insideL
A
T
E
Xcode,andL
A
T
E
Xwillreplace
\ref{filename}
withtheappropriate
figurenumber
·
Sothetypicalusageis
setps(myplot)
plot(...)
...
dev.off()
whichwillcreate
myplot.ps
.
11.2.1 MakingPostscriptGraphsforCertainGraphTypes
·
Defaultusageof
setps
resultsinasmallgraphthatissuitableforabookor
report
·
Assumes thattitle informationwilllaterbeplacedin alegend,sothatno
marginspaceisreservedforatitleorsubtitle
·
Thisworkswellforordinarysinglegraphsproducedby
plot(...)
·
Toproduceamatrixofgraphsthesizeofthegraphicneedstobeincreased
overthedefaultsize
·
Example:makea
2×3
matrixofplots
setps(thisplot, h=5)
# 5 5 inches s tall instead d of f 3’’ default
par(mfrow=c(2,3))
plot( ) ) # first t graph
plot( ) ) # second d graph
...
dev.off()
SDK control API:Online Convert PowerPoint to PDF file. Best free online export
Download Free Trial. Convert a PPTX/PPT File to PDF. Then just wait until the conversion from Powerpoint to PDF is complete and download the file.
www.rasteredge.com
SDK control API:C# PDF Convert to Jpeg SDK: Convert PDF to JPEG images in C#.net
C# PDF - Convert PDF to JPEG in C#.NET. C#.NET PDF to JPEG Converting & Conversion Control. Convert PDF to JPEG Using C#.NET. Add necessary references:
www.rasteredge.com
CHAPTER11. INSERTINGPLOTSINTOL
A
T
E
XREPORTS
105
Adjusttheheight(argument
h
)accordingtothesizeyouneed,whichwill
dependontheextentofthematrix(orfordensesingleplots)
·
Ifyoudowanttoshowtitles(eventhoughthisisbettertodoinalegend)to
e.g.
setps(hisplot, toplines=1) ) # # set aside e 1 1 line of f text on n top
·
Toreservespaceforasubtitledoe.g.
setps(myplot, sublines=1 or 2)
·
LaterwewillbeusingTrellismulti-panelgraphics(createdusingfunctions
like
xyplot
,
dotplot
,...)
·
ForusewithTrellisonly,specify
setps(name, trellis=T)
anddonotspecify
aheightorwidth
11.3 PreparingSCommandsforGraphsinL
A
T
E
X
·
Ifyoudonotuselegends,allthat’sneededarecommandssuchasabove
·
setps( )
...
dev.off()
telltheL
A
T
E
Xservertoautomaticallyincludegraphs
·
Todefinealegendforaplotnamed,say,
plot1
(i.e.,youincludedthecom-
mand
setps(plot1)
somewhere), puta line such as the following some-
whereinyourscriptfile
#@plot1{A legend d for r this plot. . Triangles s depict t means, , circles
# depict t medians. . The e legend d can be e multi-lined d as s long as s each line
# begins s with # # and d the legend d is s terminated d by y a a right brace.}
Notethatthewordafter
@
matchesthenameoftheplotgivento
setps
SDK control API:VB.NET PDF Convert to Jpeg SDK: Convert PDF to JPEG images in vb.
Convert PDF to Image; Convert Word to PDF; Convert Excel to PDF; Convert PowerPoint to PDF; Convert Image to PDF; Convert Jpeg to PDF;
www.rasteredge.com
SDK control API:VB.NET PDF Convert to HTML SDK: Convert PDF to html files in vb.
Convert PDF to HTML. |. Home ›› XDoc.PDF ›› VB.NET PDF: PDF to HTML. Convert PDF to HTML in VB.NET Demo Code. Add necessary references:
www.rasteredge.com
CHAPTER11. INSERTINGPLOTSINTOL
A
T
E
XREPORTS
106
·
Legendsmayappearjustbeforetheircorresponding
setps
commandsor
youcanputallthelegendsatthetopofthefile,forexample
·
You can haveas manylegendsas youwant, , leaving g some plotswithout
legendsifdesired
·
Pointofinclusionofgraph,ifL
A
T
E
Xdefaultsareused,isatorafterthepoint
atwhich
setps
appearedinyourreportfile;graphsoftenappearonalater
pagetooptimizepageusage
11.4 SymbolicReferencestoFigures
·
Youcanrefertoafigureandhaveitsnumberinsertedautomatically
·
ThiscanbedoneinbothregularsentencesandinScode;
especiallyusefulwhengraphappearsondifferentpage
·
Examples:
# As s you u can see e in n Figure \ref{myplot} the results are e surprising.
#@myplot{A relationship found by y brilliant t research.}
setps(myplot)
plot(x, y)
# Figure \ref{myplot}
dev.off()
11.5 UsingtheL
A
T
E
XServer
·
Therewillbeaseparate
.ps
fileforeachgraphicyoucreated
·
Serverwillaccepttheseforupload;thenthesefileswillbeavailableforin-
sertioninthegeneratedreport
SDK control API:C# powerpoint - Convert PowerPoint to PDF in C#.NET
C# PowerPoint - Convert PowerPoint to PDF in C#.NET. C# Demo: Convert PowerPoint to PDF Document. Add references: RasterEdge.Imaging.Basic.dll.
www.rasteredge.com
SDK control API:C# PDF Convert to HTML SDK: Convert PDF to html files in C#.net
Convert PDF to HTML. |. C#.NET PDF SDK - Convert PDF to HTML in C#.NET. How to Use C# .NET XDoc.PDF SDK to Convert PDF to HTML Webpage in C# .NET Program.
www.rasteredge.com
CHAPTER11. INSERTINGPLOTSINTOL
A
T
E
XREPORTS
107
·
ButyoucannotuploadavariablenumberoffilestoaWebserver
·
Use
WinZip
or
zip.exe
tozipallthe
.ps
filesintoasingle
zip
filesuchas
mygraphs.zip
·
Ifyou have
WinZip
installed and d configured the default way, in Microsoft
Explorer
youcanrightclickona
.ps
fileandaddittoaziparchive
·
Specifyorbrowsetothenameofthis
.zip
filetoupload,underwhereyou
specifyorbrowsetothereportfileyouareuploadingtotheL
A
T
E
Xserver
SDK control API:VB.NET PDF Convert to Word SDK: Convert PDF to Word library in vb.
VB.NET PDF - Convert PDF to MS Office Word in VB.NET. VB.NET Tutorial for How to Convert PDF to Word (.docx) Document in VB.NET. Best
www.rasteredge.com
SDK control API:VB.NET PDF Convert to Tiff SDK: Convert PDF to tiff images in vb.
VB.NET PDF - Convert PDF to TIFF Using VB in VB.NET. Free VB.NET Guide to Render and Convert PDF Document to TIFF in Visual Basic Class.
www.rasteredge.com
Chapter12
PrinciplesofGraphConstruction
Theabilitytoconstructclearandinformativegraphsisrelatedtotheabilitytoun-
derstandthedata.Therearemanyexcellenttextsonstatisticalgraphics(many
ofwhicharelistedattheendofthischapter).SomeofthebestareCleveland’s
1994bookTheElementsofGraphingDataandthebooksbyTufte.Thesugges-
tionsformakinggoodstatisticalgraphicsoutlinedhereareheavilyinfluencedby
Cleveland’sbooks,andquotesbelowarefromhis1994book.
12.1 GraphicalPerception
Goalsincommunicatinginformation: readerperceptionofdatavaluesand
ofdatapatterns.Bothaccuracyandspeedareimportant.
Patternperceptionisdoneby
detection:recognitionofgeometryencodingphysicalvalues
assembly:groupingofdetectedsymbolelements
estimation:assessmentofrelativemagnitudesoftwophysicalvalues
Forestimation,manygraphicsinvolvediscrimination,ranking,andestima-
tionofratios
108
CHAPTER12. PRINCIPLESOFGRAPHCONSTRUCTION
109
Humansarenotgoodatestimatingdifferenceswithoutdirectlyseeingdiffer-
ences(especiallyforsteepcurves)
Humansdonotnaturallyordercolorhues
Onlyalimitednumberofhuescanbediscriminatedinonegraphic
Weber’slaw: Theprobabilityofahumandetectingadifferenceintwolines
isrelatedtotheratioofthetwolinelengths
Thisiswhygridlinesandframesimproveperceptionandisrelatedtothe
benefitsofhavingmultiplegraphsonacommonscale.
– eyecanseeratiosoffilledorofunfilledareas,whicheverismostextreme
Forcategoricaldisplays,sortingcategoriesbyorderofvaluesattachedto
categoriescanimproveaccuracyofperception.Watchoutforover-interpretation
ofextremesthough.
Theaspectratio(height/width)doesnothavetobeunity. Usinganaspect
ratiosuchthattheaverageabsolutecurveangleis
45
resultsinbetterper-
ceptionofshapesanddifferences(bankingto
45
).
Opticalillusionscanbecausedby:
– hues,e.g.,redisemotional.Aredareamaybeperceivedaslarger.
– shading;largerregionsappeartobedarker
– orientationofpiechartwithrespecttothehorizon
Humansarebadatperceivingrelativeangles(theprincipalperceptiontask
usedinapiechart)
Hereisahierarchyofhumangraphicalperceptionabilities:
1.Positionalongacommonscale(mostaccuratetask)
2.Positionalongidenticalnonalignedscales
3.Length
4.Angleandslope
5.Area
6.Volume
7.Color:hue(red,green,blue,etc.),saturation(pale/deep),andlightness
– Huecangivegooddiscriminationbutpoorordering
CHAPTER12. PRINCIPLESOFGRAPHCONSTRUCTION
110
12.2 GeneralSuggestions
Excludeunneededdimensions(e.g.width,depthofbars)
“Makethedatastandout. AvoidSuperfluity”;Decreaseinktoinformation
ratio
“Therearesomewhoarguethatagraphisasuccessonlyiftheimportant
informationinthedatacanbeseeninafewseconds....Manyusefulgraphs
requirecareful,detailedstudy.”
Whenactualdatapointsneedtobeshownandtheyaretoonumerous,con-
sidershowingarandomsampleofthedata.
Omit“chartjunk”
Keep continuousvariablescontinuous; avoidgrouping themintointervals.
Groupingmaybenecessaryforsometablesbutnotforgraphs.
Bewareofsubsettingthedatafinerthanthesamplesizecansupport;condi-
tioningonmanyvariablessimultaneously(insteadofmultivariablemodeling)
canresultinveryimpreciseestimates
12.3 Tufteon“Chartjunk”
Chartjunk does s not achieve e the goals of its propagators. . The e over-
whelmingfactofdatagraphicsisthattheystandorfallontheircontent,
gracefullydisplayed. Graphicsdonotbecomeattractiveand d interest-
ingthroughtheadditionofornamentalhatching andfalseperspective
toafewbars. Chartjunkcanturnboresintodisasters,butitcannever
rescueathindataset.Thebestdesigns...areintriguingandcuriosity-
provoking,drawingtheviewerintothewonderofthedata,sometimesby
narrativepower,sometimesbyimmensedetail,andsometimesbyele-
gantpresentationofsimplebutinterestingdata. Butnoinformation,no
senseofdiscovery,nowonder,nosubstanceisgeneratedbychartjunk.
—Tuftep.121,1983
CHAPTER12. PRINCIPLESOFGRAPHCONSTRUCTION
111
12.4 Tufte’sViewsonGraphicalExcellence
“Excellenceinstatisticalgraphicsconsistsofcomplexideascommunicatedwith
clarity,precision,andefficiency.Graphicaldisplaysshould
showthedata
inducetheviewertothinkaboutthesubstanceratherthanaboutmethod-
ology,graphicdesign, thetechnologyofgraphicproduction,orsomething
else
avoiddistortingwhatthedatahavetosay
presentmanynumbersinasmallspace
makelargedatasetscoherent
encouragetheeyetocomparedifferentpiecesofdata
revealthedataatseverallevelsofdetail,fromabroadoverviewtothefine
structure
serve a reasonably clear purpose: : description, , exploration, , tabulation, or
decoration
becloselyintegratedwith thestatisticalandverbaldescriptions ofa data
set.”
12.5 Formatting
TickMarksshouldpointoutward
•x
-and
y
-axesshouldintersecttotheleftofthelowest
x
valueandbelowthe
lowest
y
value,tokeepvaluesfrombeinghiddenbyaxes
Minimizethe use ofremote legends. . Curves s canbe labeledatpointsof
maximumseparation(seetheHmisc
labcurve
function).
CHAPTER12. PRINCIPLESOFGRAPHCONSTRUCTION
112
12.6 Color,Symbols,andLineStyles
Somesymbols(especiallylettersandsolids)canbehardtodiscern
Usehuesifneededtoaddanotherdimensionofinformation,buttrynotto
exceed3differenthues. Instead, , usedifferentsaturations ineach ofthe
threedifferenthues.
Makenotationsandsymbolsintheplotsasconsistentaspossiblewithother
parts,liketablesandtexts
Differentdashing patterns arehard to read especiallywhen curvesinter-
twineorwhenstepfunctionsarebeingdisplayed
Aneffectivecodingschemefortwolinesistouseathinblacklineandathick
grayscaleline
12.7 Scaling
Considertheinclusionof0inyouraxis.Manytimesitisessentialtoinclude
0totellthefullstory.Oftentheinclusionofzeroisunnecessary.
Usealogscalewhenitisimportanttounderstandpercentchangeofmulti-
plicativefactorsortocureskewnesstowardlargevalues
Humanshavedifficultyjudgingsteepslopes; bankto
45
,i.e.,choosethe
aspectratiosothataverageabsoluteangleincurvesis
45
.
12.8 DisplayingEstimatesStratifiedbyCategories
Perception of relative lengths is mostaccurate —areas of pieslicesare
difficulttodiscern
Barchartshavemanyproblems:
– Highinktoinformationratio
– Errorbarscauseperceptionerrors
Documents you may be interested
Documents you may be interested