[rkward-cvs] SF.net SVN: rkward: [1678] trunk/rkward/rkward/plugins
kapatp at users.sourceforge.net
kapatp at users.sourceforge.net
Wed Mar 21 07:25:54 UTC 2007
Revision: 1678
http://svn.sourceforge.net/rkward/?rev=1678&view=rev
Author: kapatp
Date: 2007-03-21 00:25:54 -0700 (Wed, 21 Mar 2007)
Log Message:
-----------
grid in plot_options
Modified Paths:
--------------
trunk/rkward/rkward/plugins/distributions/plot_beta_distribution.php
trunk/rkward/rkward/plugins/distributions/plot_beta_distribution.xml
trunk/rkward/rkward/plugins/plots/plot_options.xml
trunk/rkward/rkward/plugins/x11device/grid.php
trunk/rkward/rkward/plugins/x11device/grid.xml
Modified: trunk/rkward/rkward/plugins/distributions/plot_beta_distribution.php
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_beta_distribution.php 2007-03-21 02:03:48 UTC (rev 1677)
+++ trunk/rkward/rkward/plugins/distributions/plot_beta_distribution.php 2007-03-21 07:25:54 UTC (rev 1678)
@@ -1,11 +1,14 @@
<?
- function preprocess () {
- }
+function preprocess () {
+}
- function calculate () {
- }
+function calculate () {
+ global $gridoptions;
+ $gridoptions = "";
+ if (getRK_val ("plotoptions.add_grid")) $gridoptions = "try(" . getRK_val ("plotoptions.grid_options.code.printout") . ")";
+}
- function printout () {
+function printout () {
doPrintout (true);
}
@@ -20,6 +23,7 @@
}
function doPrintout ($final) {
+ global $gridoptions;
$fun = getRK_val ("function");
$log_option = "";
@@ -55,6 +59,7 @@
<? }
?>
try (curve (<? echo ($fun); ?> (x, shape1 = <? echo ($a); ?>, shape2 = <? echo ($b); ?>, ncp = <? echo ($ncp); ?><? echo ($log_option) ?><? echo ($lower_tag); ?>), from=<? echo ($min); ?>, to=<? echo ($max); ?>, n=<? echo ($n); ?><? getRK ("plotoptions.code.printout"); ?>))
+<? echo ($gridoptions); ?>
<? if ($final) { ?>
rk.graph.off ()
Modified: trunk/rkward/rkward/plugins/distributions/plot_beta_distribution.xml
===================================================================
--- trunk/rkward/rkward/plugins/distributions/plot_beta_distribution.xml 2007-03-21 02:03:48 UTC (rev 1677)
+++ trunk/rkward/rkward/plugins/distributions/plot_beta_distribution.xml 2007-03-21 07:25:54 UTC (rev 1678)
@@ -6,6 +6,7 @@
<convert id="dodist" mode="equals" sources="function.string" standard="pbeta" />
<connect client="lower.enabled" governor="dodist" />
<set id="plotoptions.allow_log" to="false"/>
+ <set id="plotoptions.allow_grid" to="true"/>
</logic>
<dialog label="Plot Beta probabilities" >
<tabbook>
Modified: trunk/rkward/rkward/plugins/plots/plot_options.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/plot_options.xml 2007-03-21 02:03:48 UTC (rev 1677)
+++ trunk/rkward/rkward/plugins/plots/plot_options.xml 2007-03-21 07:25:54 UTC (rev 1678)
@@ -5,14 +5,14 @@
<logic>
<external id="xvar" default="" />
<external id="yvar" default="" />
-
+
<external id="default_pointtype" default="" />
<external id="default_pointcolor" default="" />
<external id="default_main" default="" />
<external id="default_sub" default="" />
<external id="default_xlab" default="" />
<external id="default_ylab" default="" />
-
+
<external id="allow_log" default="true" />
<external id="allow_type" default="true" />
<external id="allow_aspect" default="false" />
@@ -58,8 +58,15 @@
<connect client="aspectratio.visible" governor="allow_aspect"/>
<connect client="pointtypepage.visible" governor="allow_type"/>
<connect client="pointtype.string" governor="default_pointtype" />
-
+
<connect client="pointcolor.default_color" governor="default_pointcolor" />
+
+ <external id="allow_grid" default="false" />
+ <connect client="add_grid.visible" governor="allow_grid"/>
+ <connect client="tab_grid.visible" governor="allow_grid"/>
+ <convert id="tab_grid_enable" sources="allow_grid;add_grid.state" mode="and" standard="true"/>
+ <connect client="tab_grid.enabled" governor="tab_grid_enable" />
+ <set id="grid_options.is_embed" to="true"/>
</logic>
<dialog label="Default plot options" >
<tabbook>
@@ -124,6 +131,7 @@
<option value="S" label="Step-function plots: the right edge defines the point" />
</dropdown>
<embed id="pointcolor" component="rkward::color_chooser" label="Color" />
+ <checkbox id="add_grid" label="Add Grid to the plot" value="1" value_unchecked="0"/>
<stretch/>
</tab>
<tab id="aspectratio" label="Aspect ratio y/x">
@@ -134,6 +142,9 @@
<stretch/>
</column>
</tab>
+ <tab id="tab_grid" label="Grid">
+ <embed id="grid_options" component="rkward::x11grid"/>
+ </tab>
</tabbook>
</dialog>
</document>
Modified: trunk/rkward/rkward/plugins/x11device/grid.php
===================================================================
--- trunk/rkward/rkward/plugins/x11device/grid.php 2007-03-21 02:03:48 UTC (rev 1677)
+++ trunk/rkward/rkward/plugins/x11device/grid.php 2007-03-21 07:25:54 UTC (rev 1678)
@@ -2,6 +2,11 @@
function preprocess () {
}
function calculate () {
+ global $gridoptions;
+ global $is_embed;
+
+ $is_embed = getRK_val ("is_embed");
+
$nx = getRK_val ("nx");
if ($nx == "other") $gridoptions = 'nx=' . getRK_val ("nx_cells");
else $gridoptions = 'nx=' . $nx;
@@ -18,11 +23,16 @@
if ($lty != "") $gridoptions .= ", lty=\"{$lty}\"";
if (!getRK_val("equilogs")) $gridoptions .= ', equilogs=FALSE';
+ if ($is_embed=="false") {
?>
dev.set (<? getRK ("devnum"); ?>)
grid(<? echo ($gridoptions); ?>);
<?
+ }
}
function printout () {
+ global $gridoptions;
+ global $is_embed;
+ if ($is_embed=="true") echo ("grid(" . $gridoptions . ")");
}
?>
\ No newline at end of file
Modified: trunk/rkward/rkward/plugins/x11device/grid.xml
===================================================================
--- trunk/rkward/rkward/plugins/x11device/grid.xml 2007-03-21 02:03:48 UTC (rev 1677)
+++ trunk/rkward/rkward/plugins/x11device/grid.xml 2007-03-21 07:25:54 UTC (rev 1678)
@@ -4,6 +4,7 @@
<help file="grid.rkh" />
<logic>
<external id="devnum"/>
+ <external id="is_embed" default="false"/>
<convert id="nx_other" sources="nx.string" mode="equals" standard="other"/>
<connect client="nx_cells.enabled" governor="nx_other"/>
@@ -36,7 +37,7 @@
<checkbox id="equilogs" label="Equilogs" checked="true"/>
</row>
<row>
- <spinbox id="lwd" label="Line width" min="0" initial="0.1"/>
+ <spinbox id="lwd" type="integer" label="Line width" min="1" initial="1"/>
<dropdown id="linetype" label="Line type" >
<option value="" label="Default" checked="true"/>
<option value="solid" label="Solid"/>
@@ -48,5 +49,6 @@
</dropdown>
<embed id="col" component="rkward::color_chooser" label="Color"/>
</row>
+ <stretch/>
</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