[rkward-cvs] SF.net SVN: rkward: [1477] trunk/rkward/rkward/plugins
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Mon Feb 26 16:19:23 UTC 2007
Revision: 1477
http://svn.sourceforge.net/rkward/?rev=1477&view=rev
Author: tfry
Date: 2007-02-26 08:19:22 -0800 (Mon, 26 Feb 2007)
Log Message:
-----------
Make plots->histogram use histogram options, and move to under_development.pluginmap
Modified Paths:
--------------
trunk/rkward/rkward/plugins/plots/histogram.php
trunk/rkward/rkward/plugins/plots/histogram.xml
trunk/rkward/rkward/plugins/plots/histogram_options.php
trunk/rkward/rkward/plugins/plots.pluginmap
trunk/rkward/rkward/plugins/under_development.pluginmap
Modified: trunk/rkward/rkward/plugins/plots/histogram.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/histogram.php 2007-02-26 15:26:10 UTC (rev 1476)
+++ trunk/rkward/rkward/plugins/plots/histogram.php 2007-02-26 16:19:22 UTC (rev 1477)
@@ -21,30 +21,23 @@
// internal helper functions
function doPrintout ($final) {
- $breaks = getRK_val ("breaks");
- $scale = getRK_val ("scale");
+ $densityscaled = getRK_val ("densityscaled");
$bw = getRK_val ("bw");
$adjust = getRK_val ("adjust");
$narm = getRK_val ("narm");
$giveRkern = getRK_val ("giveRkern");
$x = getRK_val ("x");
- if ($breaks == "int") {
- $breaksopt = "breaks =seq (floor (min (" . $x . ", na.rm=TRUE))-0.5, ceiling (max (" . $x .", na.rm=TRUE))+0.5)";
- $breaks = "Integers";
- } else if (!empty ($breaks)) {
- $breaksopt = "breaks=\"" . $breaks . "\"";
- }
if ($final) { ?>
-rk.header ("Histogram", list ("Frequency", "<? echo $scale; ?>", "Breaks algorithm", <? echo ("\"" . $breaks . "\""); ?>, "Variable", rk.get.description (<? echo ($x); ?>)))
+rk.header ("Histogram", list ("Variable", rk.get.description (<? echo ($x); ?>)<? getRK ("histogram_opt.code.preprocess"); ?>))
rk.graph.on ()
<? }
?>
try ({
- hist (<? echo ($x); ?>, <? echo ($breaksopt); ?>, freq = <? echo $scale; ?><? getRK ("plotoptions.code.printout"); ?>)
-<? if (($scale=="FALSE") && getRK_val ("density")) { ?>
- lines(density(<? echo ($x); ?>, bw="<? echo ($bw); ?>", adjust = <? echo ($adjust); ?>, <? echo ($giveRkern); ?>, <? echo ($narm); ?>, n = <? getRK ("n"); ?>), col= "<? getRK ("col_density"); ?>")
+ hist (<? echo ($x); getRK ("histogram_opt.code.calculate"); getRK ("histogram_opt.code.printout"); getRK ("plotoptions.code.printout"); ?>)
+<? if (($densityscaled) && getRK_val ("density")) { ?>
+ lines(density(<? echo ($x); ?>, bw="<? echo ($bw); ?>", adjust = <? echo ($adjust); ?>, <? echo ($giveRkern); ?>, <? echo ($narm); ?>, n = <? getRK ("n"); ?>)<? getRK ("col_density.code.printout"); ?>)
<? } ?>
})
<? if ($final) { ?>
Modified: trunk/rkward/rkward/plugins/plots/histogram.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/histogram.xml 2007-02-26 15:26:10 UTC (rev 1476)
+++ trunk/rkward/rkward/plugins/plots/histogram.xml 2007-02-26 16:19:22 UTC (rev 1477)
@@ -6,7 +6,12 @@
<set id="plotoptions.allow_log" to="false"/>
<set id="plotoptions.allow_type" to="false"/>
- <convert id="densityscaled" mode="equals" sources="scale.string" standard="FALSE" />
+ <connect client="histogram_opt.varname" governor="x" />
+ <set id="histogram_opt.allow_freq" to="true" />
+ <set id="histogram_opt.allow_barlabels" to="true" />
+ <set id="histogram_opt.allow_addtoplot" to="false" />
+
+ <convert id="densityscaled" mode="not" sources="histogram_opt.freq.state" />
<connect client="densityoptions.enabled" governor="densityscaled" />
</logic>
<dialog label="Histogram" >
@@ -16,29 +21,20 @@
<varselector id="vars" />
<column>
<varslot multi="false" type="numeric" id="x" source="vars" label="variable(s):" required="true" />
+ <stretch/>
<preview id="preview"/>
+ <embed id="plotoptions" component="rkward::plot_options" as_button="true" label="Generic Plot Options" />
</column>
</row>
</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>
- <embed id="plotoptions" component="rkward::plot_options" as_button="true" label="Plot Options" />
- <stretch/>
+ <tab label="Histogram Options" >
+ <embed id="histogram_opt" component="rkward::histogram_options" as_button="false" />
</tab>
<tab label="Density" id="densityoptions">
<row>
<column>
- <checkbox value_unchecked="0" value="1" checked="false" id="density" label="Density" />
- <input id="col_density" initial="black" label="Color of Density"/>
+ <checkbox value_unchecked="0" value="1" checked="false" id="density" label="Plot Density curve" />
+ <embed id="col_density" component="rkward::color_chooser" label="Color" />
<dropdown id="bw" label="Bandwidth">
<option value="nrd0" label="nrd0"/>
<option value="nrd" label="nrd"/>
@@ -47,7 +43,6 @@
<option value="SJ-ste" label="SJ-ste"/>
<option value="SJ-dpi" label="SJ-dpi"/>
</dropdown>
- <stretch/>
<spinbox type="real" id="adjust" label="Adjust Bandwidth" initial="1"/>
</column>
<column>
@@ -63,6 +58,7 @@
<stretch/>
</column>
</row>
+ <stretch/>
</tab>
</tabbook>
</dialog>
Modified: trunk/rkward/rkward/plugins/plots/histogram_options.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/histogram_options.php 2007-02-26 15:26:10 UTC (rev 1476)
+++ trunk/rkward/rkward/plugins/plots/histogram_options.php 2007-02-26 16:19:22 UTC (rev 1477)
@@ -13,17 +13,17 @@
$headeroptions .= ', Breaks, "';
if ($histbreaks == "cells") {
$histbreaksoptions .= getRK_val ("histbreaks_ncells");
- $header_options .= getRK_val ("histbreaks_ncells") . 'cells"';
+ $headeroptions .= getRK_val ("histbreaks_ncells") . 'cells"';
} else if ($histbreaks == "int") {
$histbreaksoptions .= "seq (floor (min (" . $varname . ", na.rm=TRUE))-0.5, ceiling (max (" . $varname . ", na.rm=TRUE))+0.5)";
- $header_options .= 'integers"';
+ $headeroptions .= 'integers"';
}
else if ($histbreaks == "vec") {
$histbreaksoptions .= "(function(x) {y = extendrange(x,f=0.1); seq(from=y[1], to=y[2], length=" . getRK_val ("histbreaks_veclength") . ")})(" . $varname . ")";
- $header_options .= 'vector length ' . getRK_val ("histbreaks_veclength") . '"';
+ $headeroptions .= 'vector length ' . getRK_val ("histbreaks_veclength") . '"';
} else {
$histbreaksoptions .= "\"" . $histbreaks . "\"";
- $header_options .= $histbreaks . '"';
+ $headeroptions .= $histbreaks . '"';
}
$addbars = getRK_val ("addtoplot");
Modified: trunk/rkward/rkward/plugins/plots.pluginmap
===================================================================
--- trunk/rkward/rkward/plugins/plots.pluginmap 2007-02-26 15:26:10 UTC (rev 1476)
+++ trunk/rkward/rkward/plugins/plots.pluginmap 2007-02-26 16:19:22 UTC (rev 1477)
@@ -6,14 +6,12 @@
<component type="standard" id="box_plot" file="box_plot.xml" label="Box Plot" />
<component type="standard" id="density_plot" file="density_plot.xml" label="Density Plot" />
<component type="standard" id="ecdf_plot" file="ecdf_plot.xml" label="ECDF Plot" />
- <component type="standard" id="histogram" file="histogram.xml" label="Histogram" />
<component type="standard" id="scatterplot" file="scatterplot.xml" label="Scatterplot" />
<component type="standard" id="scatterplot_matrix" file="scatterplot_matrix.xml" label="Scatterplot Matrix" />
<component type="standard" id="stripchart" file="stripchart_plot.xml" label="Stripchart" />
<component type="standard" id="plot_options" file="plot_options.xml" label="Plot Options" />
<component type="standard" id="color_chooser" file="color_chooser.xml" label="Color Chooser" />
- <component type="standard" id="histogram_options" file="histogram_options.xml" label="Histogram Options" />
</components>
<hierarchy>
@@ -22,7 +20,6 @@
<entry component="box_plot" />
<entry component="density_plot" />
<entry component="ecdf_plot" />
- <entry component="histogram" />
<entry component="scatterplot" />
<entry component="scatterplot_matrix" />
<entry component="stripchart" />
Modified: trunk/rkward/rkward/plugins/under_development.pluginmap
===================================================================
--- trunk/rkward/rkward/plugins/under_development.pluginmap 2007-02-26 15:26:10 UTC (rev 1476)
+++ trunk/rkward/rkward/plugins/under_development.pluginmap 2007-02-26 16:19:22 UTC (rev 1477)
@@ -14,6 +14,9 @@
<component type="standard" id="anscombe_test" file="analysis/moments/anscombe_test.xml" label="Anscombe-Glynn test of kurtosis" />
<component type="standard" id="skewness_kurtosis" file="analysis/moments/skewness_kurtosis_test.xml" label="Skewness and Kurtosis" />
+ <component type="standard" id="histogram" file="histogram.xml" label="Histogram" />
+ <component type="standard" id="histogram_options" file="histogram_options.xml" label="Histogram Options" />
+
</components>
<hierarchy>
@@ -33,6 +36,7 @@
</menu>
</menu>
<menu id="plots" label="Plots" index="5">
+ <entry component="histogram" />
</menu>
<menu id="workspace" label="Workspace" index="5">
<entry component="setworkdir" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list