--- loncom/xml/lonplot.pm 2003/02/07 22:03:21 1.81 +++ loncom/xml/lonplot.pm 2003/05/16 15:12:49 1.84 @@ -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.84 2003/05/16 15:12:49 sakharuk 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);