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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Mar 20 12:29:08 UTC 2007


Revision: 1656
          http://svn.sourceforge.net/rkward/?rev=1656&view=rev
Author:   tfry
Date:     2007-03-20 05:29:08 -0700 (Tue, 20 Mar 2007)

Log Message:
-----------
Use the new feature to disable options in density plot (for hdr.den plot, only gaussian kernel works

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 12:17:40 UTC (rev 1655)
+++ trunk/rkward/rkward/plugins/plots/density_plot.php	2007-03-20 12:29:08 UTC (rev 1656)
@@ -37,13 +37,12 @@
 	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); ?>"))
-<?		} else { ?>
-rk.header ("Highest density regions", list ("Variable", rk.get.description (<? echo ($x); ?>)))
-<?		} ?>
+	if ($dodensity_plot) $title = "Density Plot";
+	else $title = "Highest density regions";
 
+	if ($final) { ?>
+rk.header ("<? echo ($title); ?>", 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); ?>"))
+
 rk.graph.on ()
 <?	}
 		?>
@@ -51,7 +50,7 @@
 <?	if ($dodensity_plot) { ?>
 	plot(<? echo ($density_call); getRK ("plotoptions.code.printout"); ?>)
 <?	} else { ?>
-	hdr.den(<? echo ($x); ?>, den=<? echo ($density_call); getRK ("plotoptions.code.printout"); ?>)
+	hdr.den(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 12:17:40 UTC (rev 1655)
+++ trunk/rkward/rkward/plugins/plots/density_plot.xml	2007-03-20 12:29:08 UTC (rev 1656)
@@ -6,6 +6,15 @@
 		<set id="plotoptions.allow_log" to="false"/>
 		<set id="plotoptions.allow_type" to="false"/>
 
+		<!-- only gaussian kernel works for highest density regions plot -->
+		<convert id="is_normal_density_plot" mode="equals" sources="plot_type.string" standard="density_plot"/>
+		<connect client="kern.rectangular.enabled" governor="is_normal_density_plot"/>
+		<connect client="kern.triangular.enabled" governor="is_normal_density_plot"/>
+		<connect client="kern.epanechnikov.enabled" governor="is_normal_density_plot"/>
+		<connect client="kern.biweight.enabled" governor="is_normal_density_plot"/>
+		<connect client="kern.cosine.enabled" governor="is_normal_density_plot"/>
+		<connect client="kern.optcosine.enabled" governor="is_normal_density_plot"/>
+
 		<convert id="gaussian_kernel" mode="equals" sources="kern.string" standard="gaussian"/>
 		<connect client="bw.enabled" governor="gaussian_kernel"/>
 
@@ -38,12 +47,12 @@
 								<column>
 									<dropdown id="kern" label="Smoothing Kernel">
 										<option value="gaussian" label="gaussian (default)"/>
-										<option value="rectangular" label="rectangular"/>
-										<option value="triangular" label="triangular"/>
-										<option value="epanechnikov" label="epanechnikov"/>
-										<option value="biweight" label="biweight"/>
-										<option value="cosine" label="cosine"/>
-										<option value="optcosine" label="optcosine"/>
+										<option id="rectangular" value="rectangular" label="rectangular"/>
+										<option id="triangular" value="triangular" label="triangular"/>
+										<option id="epanechnikov" value="epanechnikov" label="epanechnikov"/>
+										<option id="biweight" value="biweight" label="biweight"/>
+										<option id="cosine" value="cosine" label="cosine"/>
+										<option id="optcosine" value="optcosine" label="optcosine"/>
 									</dropdown>
 									<dropdown id="bw" label="Bandwidth">
 										<option value="nrd0" label="nrd0"/>


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