--- loncom/xml/lonplot.pm 2003/02/07 22:03:21 1.81 +++ loncom/xml/lonplot.pm 2003/06/10 18:46:02 1.85 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Dynamic plot # -# $Id: lonplot.pm,v 1.81 2003/02/07 22:03:21 albertel Exp $ +# $Id: lonplot.pm,v 1.85 2003/06/10 18:46:02 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -112,7 +112,8 @@ my $words_test = sub {$_[0]=~s/\s+/ ## ## ################################################################### my @gnuplot_edit_order = - qw/alttag bgcolor fgcolor height width font transparent grid samples border align/; + qw/alttag bgcolor fgcolor height width font transparent grid samples + border align texwidth/; my $gnuplot_help_text = <<"ENDPLOTHELP";
@@ -221,7 +222,14 @@ my %gnuplot_defaults =
description => 'alignment for image in html',
edit_type => 'choice',
choices => ['left','right','center']
- }
+ },
+ texwidth => {
+ default => '93',
+ test => $int_test,
+ description => 'Width of plot when printed (mm)',
+ edit_type => 'entry',
+ size => '5'
+ },
);
my %key_defaults =
@@ -506,7 +514,8 @@ sub end_gnuplot {
ENDIMAGE
} elsif ($target eq 'tex') {
&Apache::lonnet::ssi("/cgi-bin/plot.gif?file=$filename.data&output=eps");
- $result = '\graphicspath{{/home/httpd/perl/tmp/}}\includegraphics{'.&Apache::lonnet::unescape($filename).'.eps}';
+
+ $result = '\graphicspath{{/home/httpd/perl/tmp/}}\includegraphics[width='.$plot{'texwidth'}.' mm]{'.&Apache::lonnet::unescape($filename).'.eps}';
}
} elsif ($target eq 'edit') {
$result.=&Apache::edit::tag_end($target,$token);
@@ -798,7 +807,11 @@ sub start_function {
my $result='';
if ($target eq 'web' || $target eq 'tex') {
if (exists($curves[-1]->{'data'})) {
- &Apache::lonxml::warning('Use of