[LON-CAPA-cvs] cvs: loncom /xml lonplot.pm
raeburn
lon-capa-cvs-allow@mail.lon-capa.org
Sun, 20 Jan 2008 02:47:09 -0000
raeburn Sat Jan 19 21:47:09 2008 EDT
Modified files:
/loncom/xml lonplot.pm
Log:
Phil's addition of a rotation option for plot labels.
Index: loncom/xml/lonplot.pm
diff -u loncom/xml/lonplot.pm:1.133 loncom/xml/lonplot.pm:1.134
--- loncom/xml/lonplot.pm:1.133 Fri Dec 14 01:34:59 2007
+++ loncom/xml/lonplot.pm Sat Jan 19 21:47:06 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Dynamic plot
#
-# $Id: lonplot.pm,v 1.133 2007/12/14 06:34:59 albertel Exp $
+# $Id: lonplot.pm,v 1.134 2008/01/20 02:47:06 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -385,6 +385,13 @@
description => 'justification of the label text on the plot',
edit_type => 'choice',
choices => ['left','right','center']
+ },
+ rotate => {
+ default => 0,
+ test => $real_test,
+ description => 'Rotation of label (degrees)',
+ edit_type => 'entry',
+ size => '10',
}
);
@@ -1418,7 +1425,12 @@
my $label;
foreach $label (@labels) {
$gnuplot_input .= 'set label "'.$label->{'text'}.'" at '.
- $label->{'xpos'}.','.$label->{'ypos'}.' '.$label->{'justify'};
+ $label->{'xpos'}.','.$label->{'ypos'};
+ if ($label->{'rotate'} ne '') {
+ $gnuplot_input .= ' rotate by '.$label->{'rotate'};
+ }
+ $gnuplot_input .= ' '.$label->{'justify'};
+
if ($target eq 'tex') {
$gnuplot_input .=' font "'.$font_properties->{'printname'}.','.$fontsize.'pt"' ;
}