[rkward-cvs] SF.net SVN: rkward: [1874] trunk/rkward/rkward/plugins/distributions

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon May 7 16:45:02 UTC 2007


Revision: 1874
          http://svn.sourceforge.net/rkward/?rev=1874&view=rev
Author:   tfry
Date:     2007-05-07 09:45:01 -0700 (Mon, 07 May 2007)

Log Message:
-----------
Convert exponential, f, and gamma distribution plots to using snippets

Modified Paths:
--------------
    trunk/rkward/rkward/plugins/distributions/plot_exponential_distribution.php
    trunk/rkward/rkward/plugins/distributions/plot_exponential_distribution.rkh
    trunk/rkward/rkward/plugins/distributions/plot_exponential_distribution.xml
    trunk/rkward/rkward/plugins/distributions/plot_f_distribution.php
    trunk/rkward/rkward/plugins/distributions/plot_f_distribution.rkh
    trunk/rkward/rkward/plugins/distributions/plot_f_distribution.xml
    trunk/rkward/rkward/plugins/distributions/plot_gamma_distribution.php
    trunk/rkward/rkward/plugins/distributions/plot_gamma_distribution.rkh
    trunk/rkward/rkward/plugins/distributions/plot_gamma_distribution.xml

Modified: trunk/rkward/rkward/plugins/distributions/plot_exponential_distribution.php
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_exponential_distribution.php	2007-05-07 15:53:14 UTC (rev 1873)
+++ trunk/rkward/rkward/plugins/distributions/plot_exponential_distribution.php	2007-05-07 16:45:01 UTC (rev 1874)
@@ -1,57 +1,28 @@
 <?
-function preprocess () {
-}
+include ("plot_dist_common.php");
 
-function calculate () {
-}
+function getParameters () {
+	global $options;
 
-function printout () {
-	doPrintout (true);
-}
+	$options['rate'] = getRK_val ("rate");
+	getContRangeParameters ();
 
-function preview () {
-	preprocess ();
-	calculate ();
-	doPrintout (false);
-}
-
-function doPrintout ($final) {
-
-	$fun = getRK_val ("function");
-	$log_option = "";
-	if ($fun == "dexp") {
-		$label = "density";
-		$lower_tag = "";
-		$tail_tag = "";
-		if (getRK_val ("log")) $log_option = ", log=TRUE";
+	if ($options['is_density']) {
+		$options['fun'] = "dexp";
 	} else {
-		$label = "distribution";
-		if (getRK_val("lower") == "1") {
-			$lower_tag = ", lower.tail = TRUE";
-			$tail_tag = ", \"Tail\",\"Lower\"";
-		} else {
-			$lower_tag = ", lower.tail = FALSE";
-			$tail_tag = ", \"Tail\",\"Upper\"";
-		}
-		if (getRK_val ("log")) $log_option = ", log.p=TRUE";
+		$options['fun'] = "pexp";
 	}
-	if (getRK_val ("log") == "1") $log_label="logarithmic";
-	else $log_label="normal";
-	$n = getRK_val ("n");
-	$min = getRK_val ("min");
-	$max = getRK_val ("max");
-	$rate = getRK_val ("rate");
+}
 
-	if ($final) { ?>
-rk.header ("Exponential <? echo ($label); ?> function", list ("Number of Observations", "<? echo ($n); ?>", "Lower quantile", "<? echo ($min); ?>","Upper quantile", "<? echo ($max); ?>", "Rate", "<? echo ($rate); ?>", "Scaling", "<? echo ($log_label); ?>"<? echo ($tail_tag); ?>, "Function", "<? echo ($fun); ?>"));
+function doHeader () {
+	global $options;
 
-rk.graph.on ()
-<? }
-?>
-try (curve (<? echo ($fun); ?> (x, rate = <? echo ($rate); ?><? echo ($log_option) ?><? echo ($lower_tag); ?>), from=<? echo ($min); ?>, to=<? echo ($max); ?>, n=<? echo ($n); ?><? getRK ("plotoptions.code.printout"); ?>))
+	echo ('rk.header ("Exponential ' . $options['label'] . ' function", list ("Number of Observations", "' . $options['n'] . '", "Lower quantile", "' . $options['min'] . '", "Upper quantile", "' . $options['max'] . '", "Rate", "' . $options['rate'] . '"' . $options['log_label'] . $options['tail_label'] . ', "Function", "' . $options['fun'] . '"));' . "\n");
+}
 
-<?	if ($final) { ?>
-rk.graph.off ()
-<? }
+function doFunCall () {
+	global $options;
+
+	echo ($options['fun'] . '(x, rate=' . $options['rate'] . $options['log_option'] . $options['tail_option'] . ')');
 }
 ?>

Modified: trunk/rkward/rkward/plugins/distributions/plot_exponential_distribution.rkh
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_exponential_distribution.rkh	2007-05-07 15:53:14 UTC (rev 1873)
+++ trunk/rkward/rkward/plugins/distributions/plot_exponential_distribution.rkh	2007-05-07 16:45:01 UTC (rev 1874)
@@ -1,31 +1,25 @@
 <!DOCTYPE rkhelp>
 <document>
+	<snippets>
+		<include file="plot_dist_common_snippets.xml"/>
+	</snippets>
+
 	<summary>
 Density and distribution function plots for the Exponential distribution.
 	</summary>
 
-	<usage>
-Choose appropriate values for the various parameters of the distribution and select the type of function. The "Submit" button will export the plot to the "Output" window. To dynamically visualise the plot check the "Preview" box.
-	</usage>
+	<insert snippet="general_usage_help"/>
 
 	<settings>
-		<setting id="function">
-			<li> Density Function, or </li>
-			<li> Distribution Function </li>
-		</setting>
-		<setting id="n">Number of observations (points) for constructing the plot (n).</setting>
-		<setting id="min">Smallest value at which the function is to be plotted.</setting>
-		<setting id="max">Largest value at which the function is to be plotted. So, the function will be evaluated at 'n' equally spaced points between the lower quantile and the upper quantile (inclusive of end points).</setting>
+		<insert snippet="density_help"/>
+		<insert snippet="cont_range_help"/>
 		<setting id="rate">See R reference on Exponential distribution.</setting>
-		<setting id="log">See the description given on Plot Beta distribution help page.</setting>
-		<setting id="lower">See the description given on Plot Beta  distribution help page.</setting>
-		<setting id="preview">See the description given on Plot Beta  distribution help page.</setting>
-		<setting id="plotoptions">Various plotting parameter settings for the plot. See the help page of "Plot Options" for more details.</setting>
+		<setting id="ncp">Non-centrality parameter of the Beta distribution.</setting>
+		<insert snippet="common_options_help"/>
 	</settings>
 	<related>
 		<ul>
 			<li><link href="rkward://rhelp/Exponential"/></li>
-			<li><link href="rkward://component/plot_beta_distribution"/></li>
 			<li><link href="rkward://component/plot_options"/></li>
 			<li><link href="rkward://rhelp/curve"/></li>
 		</ul>

Modified: trunk/rkward/rkward/plugins/distributions/plot_exponential_distribution.xml
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_exponential_distribution.xml	2007-05-07 15:53:14 UTC (rev 1873)
+++ trunk/rkward/rkward/plugins/distributions/plot_exponential_distribution.xml	2007-05-07 16:45:01 UTC (rev 1874)
@@ -1,45 +1,26 @@
 <!DOCTYPE rkplugin>
-<!--This is the simple "Plot exponential probabilities" plugin--><document>
+<document>
 	<code file="plot_exponential_distribution.php" />
 	<help file="plot_exponential_distribution.rkh" />
 	<logic>
-		<convert id="dodist" mode="equals" sources="function.string" standard="pexp" />
-		<connect client="lower.enabled" governor="dodist" />
-		<set id="plotoptions.allow_log" to="false"/>
+		<insert snippet="common_logic"/>
 	</logic>
+	<snippets>
+		<snippet id="range_options">
+			<spinbox type="integer" id="n" min="2" initial="100" label="Number of Observations" />
+			<frame label="Range" >
+				<spinbox default_precision="2" type="real" id="min" initial="0" min="0" label="Lower quantile" />
+				<spinbox default_precision="2" type="real" id="max" initial="10" min="0" label="Upper quantile" />
+			</frame>
+		</snippet>
+		<snippet id="dist_options">
+			<frame label="Parameters">
+				<spinbox default_precision="2" type="real" id="rate" initial="1" min="0.01" label="Rate" />
+			</frame>
+		</snippet>
+		<include file="plot_dist_common_snippets.xml"/>
+	</snippets>
 	<dialog label="Plot Exponential probabilities" >
-		<tabbook>
-			<tab label="Plot Exponential probabilities" >
-				<row>
-					<column>
-						<row>
-							<spinbox type="integer" id="n" min="2" initial="100" label="Number of Observations" />
-						</row>
-						<row>
-							<frame label="Range" >
-								<spinbox default_precision="2" type="real" id="min" initial="0" min="0" label="Lower quantile" />
-								<spinbox default_precision="2" type="real" id="max" initial="10" min="0" label="Upper quantile" />
-							</frame>
-						</row>
-						<row>
-							<frame label="Parameters">
-							<spinbox default_precision="2" type="real" id="rate" initial="1" min="0.01" label="Rate" />
-						</frame>
-						</row>
-					</column>
-					<column>
-						<radio id="function" label="Choose type of function plot" >
-							<option value="dexp" label="Plot density function" />
-							<option value="pexp" label="Plot distribution" />
-						</radio>
-						<checkbox id="log" label="Logarithmic" value="1" value_unchecked="0"/>
-						<checkbox id="lower" label="Lower Tail" value="1" value_unchecked="0" checked="true"/>
-						<stretch/>
-						<preview id="preview" label="Preview"/>
-						<embed id="plotoptions" component="rkward::plot_options" as_button="true" label="Plot Options" />
-					</column>
-				</row>
-			</tab>
-		</tabbook>
+		<include file="plot_dist_common_dialog_layout.xml"/>
 	</dialog>
 </document>

Modified: trunk/rkward/rkward/plugins/distributions/plot_f_distribution.php
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_f_distribution.php	2007-05-07 15:53:14 UTC (rev 1873)
+++ trunk/rkward/rkward/plugins/distributions/plot_f_distribution.php	2007-05-07 16:45:01 UTC (rev 1874)
@@ -1,59 +1,30 @@
 <?
-function preprocess () {
-}
+include ("plot_dist_common.php");
 
-function calculate () {
-}
+function getParameters () {
+	global $options;
 
-function printout () {
-	doPrintout (true);
-}
+	$options['df1'] = getRK_val ("df1");
+	$options['df2'] = getRK_val ("df2");
+	$options['ncp'] = getRK_val ("ncp");
+	getContRangeParameters ();
 
-function preview () {
-	preprocess ();
-	calculate ();
-	doPrintout (false);
-}
-
-function doPrintout ($final) {
-
-	$fun = getRK_val ("function");
-	$log_option = "";
-	if ($fun == "df") {
-		$label = "density";
-		$lower_tag = "";
-		$tail_tag = "";
-		if (getRK_val ("log")) $log_option = ", log=TRUE";
+	if ($options['is_density']) {
+		$options['fun'] = "df";
 	} else {
-		$label = "distribution";
-		if (getRK_val("lower") == "1") {
-			$lower_tag = ", lower.tail = TRUE";
-			$tail_tag = ", \"Tail\",\"Lower\"";
-		} else {
-			$lower_tag = ", lower.tail = FALSE";
-			$tail_tag = ", \"Tail\",\"Upper\"";
-		}
-		if (getRK_val ("log")) $log_option = ", log.p=TRUE";
+		$options['fun'] = "pf";
 	}
-	if (getRK_val ("log") == "1") $log_label="logarithmic";
-	else $log_label="normal";
-	$n = getRK_val ("n");
-	$min = getRK_val ("min");
-	$max = getRK_val ("max");
-	$ncp = getRK_val ("ncp");
-	$df1 = getRK_val ("df1");
-	$df2 = getRK_val ("df2");
+}
 
-	if ($final) { ?>
-rk.header ("F <? echo ($label); ?> function", list ("Number of Observations", "<? echo ($n); ?>", "Lower quantile", "<? echo ($min); ?>", "Upper quantile", "<? echo ($max); ?>", "Numerator degrees of freedom", "<? echo ($df1); ?>", "Denominator degrees of freedom", "<? echo ($df2); ?>", "Non-centrality", "<? echo ($ncp); ?>", "Scaling", "<? echo ($log_label); ?>"<? echo ($tail_tag); ?>, "Function", "<? echo ($fun); ?>"));
+function doHeader () {
+	global $options;
 
-rk.graph.on ()
-<? }
-?>
-try (curve (<? echo ($fun); ?> (x, df1 = <? echo ($df1); ?>, df2 = <? echo ($df2); ?>, ncp = <? echo ($ncp); ?><? echo ($log_option) ?><? echo ($lower_tag); ?>), from=<? echo ($min); ?>, to=<? echo ($max); ?>, n=<? echo ($n); ?><? getRK ("plotoptions.code.printout"); ?>))
+	echo ('rk.header ("F ' . $options['label'] . ' function", list ("Number of Observations", "' . $options['n'] . '", "Lower quantile", "' . $options['min'] . '", "Upper quantile", "' . $options['max'] . '", "Numerator degrees of freedom", "' . $options['df1'] . '", "Denominator degrees of freedom", "' . $options['df2'] . '", "Non-centrality", "' . $options['ncp'] . '"' . $options['log_label'] . $options['tail_label'] . ', "Function", "' . $options['fun'] . '"));' . "\n");
+}
 
-<?	if ($final) { ?>
-rk.graph.off ()
-<? }
+function doFunCall () {
+	global $options;
+
+	echo ($options['fun'] . '(x, df1=' . $options['df1'] . ', df2=' . $options['df2'] . ', ncp=' . $options['ncp'] . $options['log_option'] . $options['tail_option'] . ')');
 }
 ?>

Modified: trunk/rkward/rkward/plugins/distributions/plot_f_distribution.rkh
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_f_distribution.rkh	2007-05-07 15:53:14 UTC (rev 1873)
+++ trunk/rkward/rkward/plugins/distributions/plot_f_distribution.rkh	2007-05-07 16:45:01 UTC (rev 1874)
@@ -1,33 +1,27 @@
 <!DOCTYPE rkhelp>
 <document>
+	<snippets>
+		<include file="plot_dist_common_snippets.xml"/>
+	</snippets>
+
 	<summary>
 Density and distribution function plots for the F distribution.
 	</summary>
 
-	<usage>
-Choose appropriate values for the various parameters of the distribution and select the type of function. The "Submit" button will export the plot to the "Output" window. To dynamically visualise the plot check the "Preview" box.
-	</usage>
+	<insert snippet="general_usage_help"/>
 
 	<settings>
-		<setting id="function">
-			<li> Density Function, or </li>
-			<li> Distribution Function </li>
-		</setting>
-		<setting id="n">Number of observations (points) for constructing the plot (n).</setting>
-		<setting id="min">Smallest value at which the function is to be plotted.</setting>
-		<setting id="max">Largest value at which the function is to be plotted. So, the function will be evaluated at 'n' equally spaced points between the lower quantile and the upper quantile (inclusive of end points).</setting>
+		<insert snippet="density_help"/>
+		<insert snippet="cont_range_help"/>
 		<setting id="df1">See R reference on F distribution.</setting>
 		<setting id="df2">See R reference on F distribution.</setting>
 		<setting id="ncp">See R reference on F distribution.</setting>
-		<setting id="log">See the description given on Plot Beta distribution help page.</setting>
-		<setting id="lower">See the description given on Plot Beta  distribution help page.</setting>
-		<setting id="preview">See the description given on Plot Beta  distribution help page.</setting>
-		<setting id="plotoptions">Various plotting parameter settings for the plot. See the help page of "Plot Options" for more details.</setting>
+		<insert snippet="common_options_help"/>
 	</settings>
+
 	<related>
 		<ul>
 			<li><link href="rkward://rhelp/FDist"/></li>
-			<li><link href="rkward://component/plot_beta_distribution"/></li>
 			<li><link href="rkward://component/plot_options"/></li>
 			<li><link href="rkward://rhelp/curve"/></li>
 		</ul>

Modified: trunk/rkward/rkward/plugins/distributions/plot_f_distribution.xml
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_f_distribution.xml	2007-05-07 15:53:14 UTC (rev 1873)
+++ trunk/rkward/rkward/plugins/distributions/plot_f_distribution.xml	2007-05-07 16:45:01 UTC (rev 1874)
@@ -3,43 +3,26 @@
 	<code file="plot_f_distribution.php" />
 	<help file="plot_f_distribution.rkh" />
 	<logic>
-		<convert id="dodist" mode="equals" sources="function.string" standard="pf" />
-		<connect client="lower.enabled" governor="dodist" />
-		<set id="plotoptions.allow_log" to="false"/>
+		<insert snippet="common_logic"/>
 	</logic>
+	<snippets>
+		<snippet id="range_options">
+			<spinbox type="integer" id="n" initial="100" min="1" label="Number of Observations" />
+			<frame label="Range" >
+				<spinbox default_precision="2" type="real" min="0.001" id="min" initial="0.001" label="Lower quantile" />
+				<spinbox default_precision="2" type="real" min="0.001" id="max" initial="25" label="Upper quantile" />
+			</frame>
+		</snippet>
+		<snippet id="dist_options">
+			<frame label="Parameters">
+				<spinbox default_precision="2" type="real" min="0.01" id="df1" initial="5" label="Numerator degrees of freedom" />
+				<spinbox default_precision="2" type="real" min="0.01" id="df2" initial="5" label="Denominator degrees of freedom" />
+				<spinbox default_precision="0" type="real" min="0" id="ncp" initial="0" label="Non-centrality parameter" />
+			</frame>
+		</snippet>
+		<include file="plot_dist_common_snippets.xml"/>
+	</snippets>
 	<dialog label="Plot F probabilities" >
-		<tabbook>
-			<tab label="Plot F probabilities" >
-				<row>
-					<column>
-						<row>
-							<spinbox type="integer" id="n" initial="100" label="Number of Observations" />
-						</row>
-						<row>
-							<frame label="Range" >
-								<spinbox default_precision="2" type="real" min="0.001" id="min" initial="0.001" label="Lower quantile" />
-								<spinbox default_precision="2" type="real" min="0.001" id="max" initial="25" label="Upper quantile" />
-							</frame>
-						</row>
-						<frame label="Parameters">
-								<spinbox default_precision="2" type="real" min="0.01" id="df1" initial="5" label="Numerator degrees of freedom" />
-								<spinbox default_precision="2" type="real" min="0.01" id="df2" initial="5" label="Denominator degrees of freedom" />
-								<spinbox default_precision="0" type="real" min="0" id="ncp" initial="0" label="Non-centrality parameter" />
-						</frame>
-					</column>
-					<column>
-						<radio id="function" label="Choose type of function plot" >
-							<option value="df" label="Plot density function" />
-							<option value="pf" label="Plot distribution" />
-						</radio>
-						<checkbox id="log" label="Logarithmic" value="1" value_unchecked="0"/>
-						<checkbox id="lower" label="Lower Tail" value="1" value_unchecked="0" checked="true"/>
-						<stretch/>
-						<preview id="preview" label="Preview"/>
-						<embed id="plotoptions" component="rkward::plot_options" as_button="true" label="Plot Options" />
-					</column>
-				</row>
-			</tab>
-		</tabbook>
+		<include file="plot_dist_common_dialog_layout.xml"/>
 	</dialog>
 </document>

Modified: trunk/rkward/rkward/plugins/distributions/plot_gamma_distribution.php
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_gamma_distribution.php	2007-05-07 15:53:14 UTC (rev 1873)
+++ trunk/rkward/rkward/plugins/distributions/plot_gamma_distribution.php	2007-05-07 16:45:01 UTC (rev 1874)
@@ -1,58 +1,29 @@
 <?
-function preprocess () {
-}
+include ("plot_dist_common.php");
 
-function calculate () {
-}
+function getParameters () {
+	global $options;
 
-function printout () {
-	doPrintout (true);
-}
+	$options['shape'] = getRK_val ("shape");
+	$options['rate'] = getRK_val ("rate");
+	getContRangeParameters ();
 
-function preview () {
-	preprocess ();
-	calculate ();
-	doPrintout (false);
-}
-
-function doPrintout ($final) {
-
-	$fun = getRK_val ("function");
-	$log_option = "";
-	if ($fun == "dgamma") {
-		$label = "density";
-		$lower_tag = "";
-		$tail_tag = "";
-		if (getRK_val ("log")) $log_option = ", log=TRUE";
+	if ($options['is_density']) {
+		$options['fun'] = "dgamma";
 	} else {
-		$label = "distribution";
-		if (getRK_val("lower") == "1") {
-			$lower_tag = ", lower.tail = TRUE";
-			$tail_tag = ", \"Tail\",\"Lower\"";
-		} else {
-			$lower_tag = ", lower.tail = FALSE";
-			$tail_tag = ", \"Tail\",\"Upper\"";
-		}
-		if (getRK_val ("log")) $log_option = ", log.p=TRUE";
+		$options['fun'] = "pgamma";
 	}
-	if (getRK_val ("log") == "1") $log_label="logarithmic";
-	else $log_label="normal";
-	$n = getRK_val ("n");
-	$min = getRK_val ("min");
-	$max = getRK_val ("max");
-	$shape = getRK_val ("shape");
-	$rate = getRK_val ("rate");
+}
 
-	if ($final) { ?>
-rk.header ("Gamma <? echo ($label); ?> function", list ("Number of Observations", "<? echo ($n); ?>", "Lower quantile", "<? echo ($min); ?>","Upper quantile", "<? echo ($max); ?>", "Shape", "<? echo ($shape); ?>", "Rate", "<? echo ($rate); ?>", "Scaling", "<? echo ($log_label); ?>"<? echo ($tail_tag); ?>, "Function", "<? echo ($fun); ?>"));
+function doHeader () {
+	global $options;
 
-rk.graph.on ()
-<? }
-?>
-try (curve (<? echo ($fun); ?> (x, shape = <? echo ($shape); ?>, rate = <? echo ($rate); ?><? echo ($log_option) ?><? echo ($lower_tag); ?>), from=<? echo ($min); ?>, to=<? echo ($max); ?>, n=<? echo ($n); ?><? getRK ("plotoptions.code.printout"); ?>))
+	echo ('rk.header ("Gamma ' . $options['label'] . ' function", list ("Number of Observations", "' . $options['n'] . '", "Lower quantile", "' . $options['min'] . '", "Upper quantile", "' . $options['max'] . '", "Shape", "' . $options['shape'] . '", "Rate", "' . $options['rate'] . '"' . $options['log_label'] . $options['tail_label'] . ', "Function", "' . $options['fun'] . '"));' . "\n");
+}
 
-<?	if ($final) { ?>
-rk.graph.off ()
-<? }
+function doFunCall () {
+	global $options;
+
+	echo ($options['fun'] . '(x, shape=' . $options['shape'] . ', rate=' . $options['rate'] . $options['log_option'] . $options['tail_option'] . ')'); 
 }
 ?>

Modified: trunk/rkward/rkward/plugins/distributions/plot_gamma_distribution.rkh
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_gamma_distribution.rkh	2007-05-07 15:53:14 UTC (rev 1873)
+++ trunk/rkward/rkward/plugins/distributions/plot_gamma_distribution.rkh	2007-05-07 16:45:01 UTC (rev 1874)
@@ -1,32 +1,26 @@
 <!DOCTYPE rkhelp>
 <document>
+	<snippets>
+		<include file="plot_dist_common_snippets.xml"/>
+	</snippets>
+
 	<summary>
 Density and distribution function plots for the Gamma distribution.
 	</summary>
 
-	<usage>
-Choose appropriate values for the various parameters of the distribution and select the type of function. The "Submit" button will export the plot to the "Output" window. To dynamically visualise the plot check the "Preview" box.
-	</usage>
+	<insert snippet="general_usage_help"/>
 
 	<settings>
-		<setting id="function">
-			<li> Density Function, or </li>
-			<li> Distribution Function </li>
-		</setting>
-		<setting id="n">Number of observations (points) for constructing the plot (n).</setting>
-		<setting id="min">Smallest value at which the function is to be plotted.</setting>
-		<setting id="max">Largest value at which the function is to be plotted. So, the function will be evaluated at 'n' equally spaced points between the lower quantile and the upper quantile (inclusive of end points).</setting>
+		<insert snippet="density_help"/>
+		<insert snippet="cont_range_help"/>
 		<setting id="shape">See R reference on Gamma distribution.</setting>
 		<setting id="rate">See R reference on Gamma distribution.</setting>
-		<setting id="log">See the description given on Plot Beta distribution help page.</setting>
-		<setting id="lower">See the description given on Plot Beta  distribution help page.</setting>
-		<setting id="preview">See the description given on Plot Beta  distribution help page.</setting>
-		<setting id="plotoptions">Various plotting parameter settings for the plot. See the help page of "Plot Options" for more details.</setting>
+		<insert snippet="common_options_help"/>
 	</settings>
+
 	<related>
 		<ul>
 			<li><link href="rkward://rhelp/GammaDist"/></li>
-			<li><link href="rkward://component/plot_beta_distribution"/></li>
 			<li><link href="rkward://component/plot_options"/></li>
 			<li><link href="rkward://rhelp/curve"/></li>
 		</ul>

Modified: trunk/rkward/rkward/plugins/distributions/plot_gamma_distribution.xml
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_gamma_distribution.xml	2007-05-07 15:53:14 UTC (rev 1873)
+++ trunk/rkward/rkward/plugins/distributions/plot_gamma_distribution.xml	2007-05-07 16:45:01 UTC (rev 1874)
@@ -1,46 +1,27 @@
 <!DOCTYPE rkplugin>
-<!--This is the simple "Plot gamma probabilities" plugin--><document>
+<document>
 	<code file="plot_gamma_distribution.php" />
 	<help file="plot_gamma_distribution.rkh" />
 	<logic>
-		<convert id="dodist" mode="equals" sources="function.string" standard="pgamma" />
-		<connect client="lower.enabled" governor="dodist" />
-		<set id="plotoptions.allow_log" to="false"/>
+		<insert snippet="common_logic"/>
 	</logic>
+	<snippets>
+		<snippet id="range_options">
+			<spinbox type="integer" id="n" min="2" initial="100" label="Number of Observations" />
+			<frame label="Range" >
+				<spinbox default_precision="2" type="real" id="min" initial="0.01" min="0.01" label="Lower quantile" />
+				<spinbox default_precision="2" type="real" id="max" initial="4.6" min="0.02" label="Upper quantile" />
+			</frame>
+		</snippet>
+		<snippet id="dist_options">
+			<frame label="Parameters">
+				<spinbox default_precision="2" type="real" id="shape" initial="1" min="0.01" label="Shape" />
+				<spinbox default_precision="2" type="real" id="rate" initial="1" min="0.01" label="Rate (lambda)" label="Rate or 1/Scale" />
+			</frame>
+		</snippet>
+		<include file="plot_dist_common_snippets.xml"/>
+	</snippets>
 	<dialog label="Plot Gamma probabilities" >
-		<tabbook>
-			<tab label="Plot Gamma probabilities" >
-				<row>
-					<column>
-						<row>
-							<spinbox type="integer" id="n" min="2" initial="100" label="Number of Observations" />
-						</row>
-						<row>
-							<frame label="Range" >
-								<spinbox default_precision="2" type="real" id="min" initial="0.01" min="0.01" label="Lower quantile" />
-								<spinbox default_precision="2" type="real" id="max" initial="4.6" min="0.02" label="Upper quantile" />
-							</frame>
-						</row>
-						<row>
-							<frame label="Parameters">
-							<spinbox default_precision="2" type="real" id="shape" initial="1" min="0.01" label="Shape" />
-							<spinbox default_precision="2" type="real" id="rate" initial="1" min="0.01" label="Rate (lambda)" label="Rate or 1/Scale" />
-						</frame>
-						</row>
-					</column>
-					<column>
-						<radio id="function" label="Choose type of function plot" >
-							<option value="dgamma" label="Plot density function" />
-							<option value="pgamma" label="Plot distribution" />
-						</radio>
-						<checkbox id="log" label="Logarithmic" value="1" value_unchecked="0"/>
-						<checkbox id="lower" label="Lower Tail" value="1" value_unchecked="0" checked="true"/>
-						<stretch/>
-						<preview id="preview" label="Preview"/>
-						<embed id="plotoptions" component="rkward::plot_options" as_button="true" label="Plot Options" />
-					</column>
-				</row>
-			</tab>
-		</tabbook>
+		<include file="plot_dist_common_dialog_layout.xml"/>
 	</dialog>
 </document>


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