[rkward-cvs] SF.net SVN: rkward: [909] trunk/rkward/rkward/plugins/plots
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Tue Oct 31 13:35:59 UTC 2006
Revision: 909
http://svn.sourceforge.net/rkward/?rev=909&view=rev
Author: tfry
Date: 2006-10-31 05:35:52 -0800 (Tue, 31 Oct 2006)
Log Message:
-----------
Allow specification of titles and aspect ratio (sjar, small adjustments by tfry)
Modified Paths:
--------------
trunk/rkward/rkward/plugins/plots/plot_options.php
trunk/rkward/rkward/plugins/plots/plot_options.xml
Modified: trunk/rkward/rkward/plugins/plots/plot_options.php
===================================================================
--- trunk/rkward/rkward/plugins/plots/plot_options.php 2006-10-31 13:01:10 UTC (rev 908)
+++ trunk/rkward/rkward/plugins/plots/plot_options.php 2006-10-31 13:35:52 UTC (rev 909)
@@ -6,7 +6,7 @@
}
function printout () {
- $log; $xaxt; $yaxt; $xlim; $ylim; $xlab; $ylab;
+ $log; $xaxt; $yaxt; $xlim; $ylim; $xlab; $ylab; $main; $sub;
$xvars = split ("\n", getRK_val ("xvar"));
if (count ($xvars) > 1) {
@@ -65,7 +65,6 @@
$ylab = "\"" . $ylab . "\"";
}
if ($ylab != "") $ylab = ", ylab=" . $ylab;
-
$yminvalue = getRK_val ("yminvalue");
$ymaxvalue = getRK_val ("ymaxvalue");
if (($yminvalue != "") || ($ymaxvalue != "")) {
@@ -85,8 +84,29 @@
$type = getRK_val ("pointtype");
if (!empty ($type)) $type = ", type=\"" . $type . "\"";
+ ///Begin of Additions by Stefan Roediger
+ //add a main (on top) to the plot
+ $main = getRK_val ("main");
+ if (($main != "") && (getRK_val ("mainisexp") != "1")) {
+ $main = "\"" . $main . "\"";
+ }
+ if ($main != "") $main = ", main=" . $main;
+
+ //add a subtitle (at bottom) to the plot
+ $sub = getRK_val ("sub");
+ if (($sub != "") && (getRK_val ("subisexp") != "1")) {
+ $sub = "\"" . $sub . "\"";
+ }
+ if ($sub != "") $sub = ", sub=" . $sub;
+
+ //define the aspect y/x of the plot
+ $asp = getRK_val ("asp");
+ if ($asp != 0) $asp = ", asp=" . $asp;
+ else $asp = "";
+ ///End of Additions by Stefan Roediger
+
// make option string
- $options = $type . $xaxt . $yaxt . $log . $xlim . $ylim . $xlab . $ylab;
+ $options = $type . $xaxt . $yaxt . $log . $xlim . $ylim . $xlab . $ylab . $main . $sub . $asp;
echo ($options);
}
Modified: trunk/rkward/rkward/plugins/plots/plot_options.xml
===================================================================
--- trunk/rkward/rkward/plugins/plots/plot_options.xml 2006-10-31 13:01:10 UTC (rev 908)
+++ trunk/rkward/rkward/plugins/plots/plot_options.xml 2006-10-31 13:35:52 UTC (rev 909)
@@ -7,18 +7,33 @@
<convert id="ylabfilled" mode="notequals" sources="ylab.text" standard="" />
<connect client="ylabisexp.enabled" governor="ylabfilled" />
-
+
<connect client="xlog.visible" governor="allow_log"/>
<connect client="ylog.visible" governor="allow_log"/>
+ <connect client="aspectratio.visible" governor="allow_aspect"/>
<connect client="pointtypepage.visible" governor="allow_type"/>
<external id="xvar" />
<external id="yvar" />
<external id="allow_log" default="true" />
<external id="allow_type" default="true" />
+ <external id="allow_aspect" default="false" />
</logic>
<dialog label="Default plot options" >
<tabbook>
+ <tab label="Title">
+ <column>
+ <frame label="Main title">
+ <input id="main" label="Main title (on top). Leave empty for default title" />
+ <checkbox id="mainisexp" label="Interpret this label as an R expression (as opposed to a literal string)?" value="1" />
+ </frame>
+ <frame label="Subtitle">
+ <input id="sub" label="Sub-title (at bottom). Leave empty for default title" />
+ <checkbox id="subisexp" label="Interpret this label as an R expression (as opposed to a literal string)?" value="1" />
+ </frame>
+ <stretch/>
+ </column>
+ </tab>
<tab label="Axes" >
<column>
<frame id="axistypes" label="Axis types">
@@ -52,6 +67,7 @@
<input id="ymaxvalue" label="Max Y value" />
</row>
</frame>
+ <stretch/>
</column>
</tab>
<tab id="pointtypepage" label="Points / Lines">
@@ -67,6 +83,14 @@
</radio>
<stretch/>
</tab>
+ <tab id="aspectratio" label="Aspect ratio y/x">
+ <column>
+ <spinbox type="real" label="Aspect ratio" id="asp" initial="0"/>
+ <text>Note that if Aspect is a finite positive value then the window is set up so that one data unit in the x direction is equal in length to asp * one data unit in the y direction.</text>
+ <text>The special case Aspect == 1 produces plots where distances between points are represented accurately on screen. Values with Aspect > 1 can be used to produce more accurate maps when using latitufile and longitude.</text>
+ <stretch/>
+ </column>
+ </tab>
</tabbook>
</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