[rkward-cvs] rkward/rkward/plugins/plots histogram.php,1.3,1.4 histogram.xml,1.5,1.6
Thomas Friedrichsmeier
tfry at users.sourceforge.net
Tue Apr 11 00:16:44 UTC 2006
Update of /cvsroot/rkward/rkward/rkward/plugins/plots
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6135/plots
Modified Files:
histogram.php histogram.xml
Log Message:
Default R method of producing histograms is too strange. Adding some more options
Index: histogram.php
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugins/plots/histogram.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** histogram.php 5 Apr 2006 15:03:30 -0000 1.3
--- histogram.php 11 Apr 2006 00:16:42 -0000 1.4
***************
*** 7,15 ****
function printout () {
?>
! rk.header ("Histogram", list ("Frequency", "<? getRK ("scale"); ?>"))
cat ("<h1>Histogram</h1>")
rk.graph.on ()
! plot (hist (<? getRK ("x"); ?>, freq = <? getRK ("scale"); ?>)<? getRK ("plotoptions.code.printout"); ?>)
rk.graph.off ()
<?
--- 7,24 ----
function printout () {
+ $breaks = getRK_val ("breaks");
+ $scale = getRK_val ("scale");
+ $x = getRK_val ("x");
+ if ($breaks == "int") {
+ $breaksopt = "breaks=seq (as.integer (min (" . $x . "))-0.5, as.integer (max (" . $x ."))+0.5)";
+ $breaks = "Integers";
+ } else if (!empty ($breaks)) {
+ $breaksopt = "breaks=\"" . $breaks . "\"";
+ }
?>
! rk.header ("Histogram", list ("Frequency", "<? echo $scale; ?>", "Breaks algorithm", <? echo ("\"" . $breaks . "\""); ?>, "Variable", rk.get.description (<? echo ($x); ?>)))
cat ("<h1>Histogram</h1>")
rk.graph.on ()
! hist (<? echo ($x); ?>, <? echo ($breaksopt); ?>, freq = <? echo $scale; ?><? getRK ("plotoptions.code.printout"); ?>)
rk.graph.off ()
<?
Index: histogram.xml
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugins/plots/histogram.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** histogram.xml 5 Apr 2006 14:32:06 -0000 1.5
--- histogram.xml 11 Apr 2006 00:16:42 -0000 1.6
***************
*** 16,22 ****
</tab>
<tab label="Options" >
! <radio id="scale" label="Scale" >
! <option value="FALSE" label="No Frequency" />
! <option value="TRUE" label="Frequency" />
</radio>
<checkbox value_unchecked="0" checked="false" value="1" id="rug" label="Rug" />
--- 16,28 ----
</tab>
<tab label="Options" >
! <radio id="breaks" label="Method of setting breakpoints" >
! <option value="Sturges" label="Sturges" />
! <option value="Scott" label="Scott" />
! <option value="FD" label="Friedman-Diaconis" />
! <option checked="true" value="int" label="Integer numbers" />
! </radio>
! <radio id="scale" label="Y Scale" >
! <option value="TRUE" label="Frequency" />
! <option value="FALSE" label="Density" />
</radio>
<checkbox value_unchecked="0" checked="false" value="1" id="rug" label="Rug" />
More information about the rkward-tracker
mailing list