[rkward-cvs] SF.net SVN: rkward: [1654] trunk/rkward/rkward/plugins/plots

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Mar 20 00:22:54 UTC 2007


Revision: 1654
          http://svn.sourceforge.net/rkward/?rev=1654&view=rev
Author:   tfry
Date:     2007-03-19 17:22:54 -0700 (Mon, 19 Mar 2007)

Log Message:
-----------
Just found out, that hdr.den() will take a ready density estimate as a parameter.
This allows much more consistent use of options.

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/plots/density_plot.php
    trunk/rkward/rkward/plugins/plots/density_plot.xml

Modified: trunk/rkward/rkward/plugins/plots/density_plot.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/density_plot.php	2007-03-20 00:04:15 UTC (rev 1653)
+++ trunk/rkward/rkward/plugins/plots/density_plot.php	2007-03-20 00:22:54 UTC (rev 1654)
@@ -33,6 +33,10 @@
 	}
 	$dorug = getRK_val ("rug");
 
+	$density_call = "density(" . $x;
+	if (!empty ($bw)) $density_call .= ", bw=\"" . $bw . "\"";
+	$density_call .= ", adjust=" . $adjust . ", kern=\"" . $kern . "\", n=" . $resolution . ", " . $narm . ")";
+
 	if ($final) {
 		if ($dodensity_plot) { ?>
 rk.header ("Density Plot", list ("Variable", rk.get.description (<? echo ($x); ?>)<? if (!empty ($bw)) { ?>, "Band Width", "<? echo ($bw); ?>"<? } ?>, "Adjust", <? echo ($adjust) ?>, "Remove Missing Values", <? echo ($narm) ?>, "Length", length (<? echo ($x); ?>), "Resolution", <? echo ($resolution); ?>, "Smoothing Kernel", "<? echo ($kern); ?>"))
@@ -45,9 +49,9 @@
 		?>
 try ({
 <?	if ($dodensity_plot) { ?>
-	plot (density(<? echo ($x); if (!empty ($bw)) echo (", bw=\"" . $bw . "\""); ?>, adjust = <? echo ($adjust); ?>, kern = "<? echo ($kern); ?>", n = <? echo ($resolution); ?>, <? echo ($narm); ?>)<? getRK ("plotoptions.code.printout"); ?>)
+	plot(<? echo ($density_call); getRK ("plotoptions.code.printout"); ?>)
 <?	} else { ?>
-	hdr.den(<? echo ($x); ?><? getRK ("plotoptions.code.printout"); ?>)
+	hdr.den(<? echo ($x); ?>, den=<? echo ($density_call); getRK ("plotoptions.code.printout"); ?>)
 <?	}
 	if ($dorug) { ?>
 	rug(<? echo ($x); ?>, <? getRK ("rug_ticksize"); ?>, <? getRK ("rug_lwd"); ?>, <? getRK ("rug_side"); ?><? getRK ("rug_col.code.printout"); ?>)

Modified: trunk/rkward/rkward/plugins/plots/density_plot.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/density_plot.xml	2007-03-20 00:04:15 UTC (rev 1653)
+++ trunk/rkward/rkward/plugins/plots/density_plot.xml	2007-03-20 00:22:54 UTC (rev 1654)
@@ -6,14 +6,8 @@
 		<set id="plotoptions.allow_log" to="false"/>
 		<set id="plotoptions.allow_type" to="false"/>
 
-		<convert id="regular_density_plot" mode="equals" sources="plot_type.string" standard="density_plot"/>
-		<connect client="kern.enabled" governor="regular_density_plot"/>
 		<convert id="gaussian_kernel" mode="equals" sources="kern.string" standard="gaussian"/>
-		<convert id="bw_type_enabled" mode="and" sources="kern.enabled;gaussian_kernel"/>
-		<connect client="bw.enabled" governor="bw_type_enabled"/>
-		<connect client="adjust.enabled" governor="regular_density_plot"/>
-		<connect client="narm.enabled" governor="regular_density_plot"/>
-		<connect client="n.enabled" governor="regular_density_plot"/>
+		<connect client="bw.enabled" governor="gaussian_kernel"/>
 
 		<connect client="rug_ticksize.enabled" governor="rug.state"/>
 		<connect client="rug_lwd.enabled" governor="rug.state"/>


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