--- loncom/xml/lonplot.pm 2005/05/16 21:58:41 1.107 +++ loncom/xml/lonplot.pm 2005/06/07 22:30:42 1.109 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Dynamic plot # -# $Id: lonplot.pm,v 1.107 2005/05/16 21:58:41 foxr Exp $ +# $Id: lonplot.pm,v 1.109 2005/06/07 22:30:42 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -39,6 +39,8 @@ use Apache::lonnet; use vars qw/$weboutputformat $versionstring/; + + BEGIN { &Apache::lonxml::register('Apache::lonplot',('gnuplot')); # @@ -48,8 +50,10 @@ BEGIN { if ($versionstring =~ /^gnuplot 4/) { $weboutputformat = 'png'; } + } + ## ## Description of data structures: ## @@ -535,7 +539,9 @@ ENDIMAGE &Apache::lonxml::debug(" gnuplot ht = $Apache::lonplot::plot{'height'}"); #might be inside the safe space, register the URL for later &Apache::lonxml::register_ssi("/cgi-bin/plot.gif?file=$filename.data&output=eps"); - $result = '\graphicspath{{/home/httpd/perl/tmp/}}\includegraphics[width='.$Apache::lonplot::plot{'texwidth'}.' mm]{'.&Apache::lonnet::unescape($filename).'.eps}'; + $result = "%DYNAMICIMAGE:$Apache::lonplot::plot{'width'}:$Apache::lonplot::plot{'height'}:$Apache::lonplot::plot{'texwidth'} \n"; + $result .= '\graphicspath{{/home/httpd/perl/tmp/}}'."\n"; + $result .= '\includegraphics[width='.$Apache::lonplot::plot{'texwidth'}.' mm]{'.&Apache::lonnet::unescape($filename).'.eps}'; } } elsif ($target eq 'edit') { $result.=&Apache::edit::tag_end($target,$token);