Open main menu

Changes

[[Image:Test-ghostscript-barcode.png|900px]]
 
 
 
 
 
== R ==
<texcode>
 
\startluacode
function testR(samples,outpdf,w,h,kernel)
require("python")
testR = python.import("test-R")
dens = testR.density(samples,outpdf,w,h,kernel)
dens.run()
end
\stopluacode
 
\def\plotdenstiy[#1]{%
\getparameters[R][#1]%
\expanded{\ctxlua{testR("\Rsamples","\Routpdf",\Rwidth,\Rheight,"\Rkernel")}}%
}
 
\starttext
\startTEXpage
\plotdenstiy[samples={u-random-int},outpdf={test-001.pdf},width={10},height={7},kernel={o}]
\setupcombinations[location=top]
\startcombination[2*1]
{\vbox{\hsize=7in\ssd
 
This is a density plot of around {\tt 100 000} random numbers between $0$ and $2^{16}-1$ generated from {\tt /dev/urandom}}}{}
{\externalfigure[test-001.pdf]}{}
\stopcombination
\stopTEXpage
\stoptext
</texcode>
 
<!--[[Image:TestPIL.jpg]]-->